Examples of PaxLoggingEvent


Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

                }
            };
            try {
                events.addAppender(appender);
                while (doDisplay) {
                    PaxLoggingEvent logEvent = queue.take();
                    if (logEvent != null) {
                        display(cnv, logEvent, out);
                    }
                }
            } catch (InterruptedException e) {
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

            };
            try {
                logService.addAppender(appender);
               
                while (doDisplay) {
                    PaxLoggingEvent event = queue.take();
                    if (event != null) {
                        printEvent(out, event);
                    }
                }
            } catch (InterruptedException e) {
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

    @Argument(index = 0, name = "logger", description = "The name of the logger. This can be ROOT, ALL, or the name of a logger specified in the org.ops4j.pax.logger.cfg file.", required = false, multiValued = false)
    String logger;
   
    protected Object doExecute() throws Exception {
        PaxLoggingEvent throwableEvent = logService.getLastException(logger);
        if (throwableEvent != null) {
            for (String r : throwableEvent.getThrowableStrRep()) {
                System.out.println(r);
            }
            System.out.println();
        }
        return null;
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

        events.clear();
    }
   
    @Override
    public PaxLoggingEvent getLastException(String logger) {
        PaxLoggingEvent throwableEvent = null;
        Iterable<PaxLoggingEvent> le = getEvents();
        for (PaxLoggingEvent event : le) {
            // if this is an exception, and the log is the same as the requested log,
            // then save this exception and continue iterating from oldest to newest
            if ((event.getThrowableStrRep() != null)
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

    private final LoggingEventFormat format = new LogstashEventFormat();

    @Test
    public void testBasicLogstashFormat() throws JSONException {
        PaxLoggingEvent event = MockEvents.createInfoEvent();

        JSONObject object = new JSONObject(format.toString(event));
        assertEquals(MockEvents.LOG_MESSAGE, object.get(LogstashEventFormat.MESSAGE));
        assertEquals(MockEvents.LOGGER_NAME, object.get(LogstashEventFormat.SOURCE));
        assertEquals("INFO", object.getJSONArray(LogstashEventFormat.TAGS).get(0));
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

                }
            };
            try {
                events.addAppender(appender);
                while (doDisplay) {
                    PaxLoggingEvent logEvent = queue.take();
                    if (logEvent != null) {
                        display(cnv, logEvent, out);
                    }
                }
            } catch (InterruptedException e) {
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

    public void setEvents(LruList events) {
        this.events = events;
    }

    protected Object doExecute() throws Exception {
        PaxLoggingEvent throwableEvent = null;
        Iterable<PaxLoggingEvent> le = events.getElements(Integer.MAX_VALUE);
        for (PaxLoggingEvent event : le) {
            if (event.getThrowableStrRep() != null) {
                throwableEvent = event;
                // Do not break, as we iterate from the oldest to the newest event
            }
        }
        if (throwableEvent != null) {
            for (String r : throwableEvent.getThrowableStrRep()) {
                System.out.println(r);
            }
            System.out.println();
        }
        return null;
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

    public void setEvents(LruList<PaxLoggingEvent> events) {
        this.events = events;
    }

    protected Object doExecute() throws Exception {
        PaxLoggingEvent throwableEvent = null;
        Iterable<PaxLoggingEvent> le = events.getElements(Integer.MAX_VALUE);
        for (PaxLoggingEvent event : le) {
            if (event.getThrowableStrRep() != null) {
                throwableEvent = event;
                // Do not break, as we iterate from the oldest to the newest event
            }
        }
        if (throwableEvent != null) {
            for (String r : throwableEvent.getThrowableStrRep()) {
                io.out.println(r);
            }
            io.out.println();
        }
        return Result.SUCCESS;
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

                }
            };
            try {
                events.addAppender(appender);
                while (doDisplay) {
                    PaxLoggingEvent logEvent = queue.take();
                    if (logEvent != null) {
                        display(cnv, logEvent, out);
                    }
                }
            } catch (InterruptedException e) {
View Full Code Here

Examples of org.ops4j.pax.logging.spi.PaxLoggingEvent

            }
        };
        try {
            logService.addAppender(appender);
            for (;;) {
              PaxLoggingEvent event = queue.take();
              printEvent(out, event);
            }
        } catch (InterruptedException e) {
            // Ignore
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.