Package ch.qos.logback.classic.spi

Examples of ch.qos.logback.classic.spi.LoggingEvent


                description.appendText("level: ").appendValue(level).appendText(", marker: ").appendValue(marker)
                        .appendText(", text:").appendValue(text);
            }

            public boolean matches(Object o) {
                LoggingEvent event = (LoggingEvent) o;
                return event.getLevel().equals(level) && event.getMessage().equals(text) && event.getMarker() == marker;
            }
        };

        context.checking(new Expectations() {{
            one(appender).doAppend(with(matcher));
View Full Code Here


        MDC.put("FloatField", "2.71828");
        MDC.put("doubleField", "3E-50");
        MDC.put("DoubleField", "3E50");
        MDC.put("foo", "bar");

        LoggingEvent event = new LoggingEvent("my.class.name", logger, Level.INFO, "hello",  null, null);

        GelfConverter converter;
        Map<String, Object> additionalFields;

        // test including full MDC
View Full Code Here

        assertThat(gelfString.contains("\"_marker\""), is(equalTo(useMarker)));
        assertThat(gelfString.contains(markerString), is(equalTo(useMarker)));
    }

    private LoggingEvent createEvent(boolean addMarker) {
        LoggingEvent hello = new LoggingEvent("my.class.name", logger, Level.INFO, "hello", null, null);
        if (addMarker) {
            hello.setMarker(marker);
        }
        return hello;
    }
View Full Code Here

        _mongoDBAppender.start();
    }

    @Test
    public void testLog() {
        LoggingEvent e = new LoggingEvent();
        e.setMessage("log message");
        e.setLevel(Level.DEBUG);
        e.setTimeStamp(System.currentTimeMillis());
        e.setLoggerName("my.logger");
        e.setCallerData(Thread.currentThread().getStackTrace());       
        _mongoDBAppender.append(e);
    }
View Full Code Here

  }

  private void buildLoggingEventAndAppend(final String localFQCN,
      final Marker marker, final Level level, final String msg,
      final Object[] params, final Throwable t) {
    LoggingEvent le = new LoggingEvent(localFQCN, this, level, msg, t, params);
    le.setMarker(marker);
    callAppenders(le);
  }
View Full Code Here

    public FilterReply decide(E eventObject) {
        if (!isStarted()) {
            return FilterReply.NEUTRAL;
        }

        LoggingEvent event = (LoggingEvent) eventObject;

        if (this.levelMin != null && !event.getLevel().isGreaterOrEqual(levelMin)) {
            return DENY;
        }

        if (this.levelMax != null && event.getLevel().toInt() > levelMax.toInt()) {
            return DENY;
        }

        if (acceptOnMatch) {
            return ACCEPT;
View Full Code Here

      }
    } else if (decision == FilterReply.DENY) {
      return;
    }
   
    LoggingEvent le = new LoggingEvent(localFQCN, this, level, msg, t, params);
    le.setMarker(marker);
    callAppenders(le);
   
  }
View Full Code Here

      logger.error("Could not read JMS message.", e);
    }
  }

  public void onMessage(javax.jms.Message message) {
    LoggingEvent event;
    try {
      if (message instanceof ObjectMessage) {
        ObjectMessage objectMessage = (ObjectMessage) message;
        event = (LoggingEvent) objectMessage.getObject();
        logger.callAppenders(event);
View Full Code Here

      logger.error("Could not read JMS message.", e);
    }
  }

  public void onMessage(javax.jms.Message message) {
    LoggingEvent event;
    try {
      if (message instanceof ObjectMessage) {
        ObjectMessage objectMessage = (ObjectMessage) message;
        event = (LoggingEvent) objectMessage.getObject();
        logger.callAppenders(event);
View Full Code Here

  }

  private void buildLoggingEventAndAppend(final String localFQCN,
      final Marker marker, final Level level, final String msg,
      final Object[] params, final Throwable t) {
    LoggingEvent le = new LoggingEvent(localFQCN, this, level, msg, t, params);
    le.setMarker(marker);
    callAppenders(le);
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.spi.LoggingEvent

Copyright © 2018 www.massapicom. 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.