Package ch.qos.logback.classic.spi

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


    jee
        .setExpression("level >= INFO && x.matches(message) && marker.contains(\"BLUE\")");
    jee.addMatcher(matcherX);
    jee.start();

    LoggingEvent event = makeLoggingEvent(null);
    event.setMarker(MarkerFactory.getMarker("BLUE"));
    assertTrue(jee.evaluate(event));
  }
View Full Code Here


  @Test
  public void throwable_LBCLASSIC_155_I() throws EvaluationException {
    jee.setExpression("throwable instanceof java.io.IOException");
    jee.start();

    LoggingEvent event = makeLoggingEvent(new IOException(""));
    assertTrue(jee.evaluate(event));
  }
View Full Code Here

  @Test
  public void throwable_LBCLASSIC_155_II() throws EvaluationException {
    jee.setExpression("throwableProxy.getClassName().contains(\"IO\")");
    jee.start();

    LoggingEvent event = makeLoggingEvent(new IOException(""));
    assertTrue(jee.evaluate(event));
  }
View Full Code Here

  public void nullMDC() throws EvaluationException {
    MDC.clear();
    jee.setExpression("mdc.isEmpty()");
    jee.start();

    LoggingEvent event = makeLoggingEvent(null);
    assertTrue(jee.evaluate(event));
  }
View Full Code Here

    Object[] parameterValues = new Object[1];
    LoggerContext lc = new LoggerContext();
   
    Logger logger = lc.getLogger(JaninoTest.class);
    LoggingEvent loggingEvent = new LoggingEvent("toto", logger, Level.INFO, "hi", null);
    parameterValues[0] = loggingEvent;
   
    Object res = ee.evaluate(parameterValues);

    // Print expression result.
View Full Code Here

   */
  public static void main(String[] args) throws Exception {

    LoggerContext lc = new LoggerContext();
    Logger logger = lc.getLogger(JaninoTest.class);
    LoggingEvent loggingEvent = new LoggingEvent("toto", logger, Level.INFO,
        "hi", null);

    // Create an expression object
    String jexlExp = "e.message == 'hix'";
    Expression e = ExpressionFactory.createExpression(jexlExp);
View Full Code Here

  public void setUp() {
    pl.setContext(lc);
  }

  ILoggingEvent makeLoggingEvent(Exception ex) {
    return new LoggingEvent(
            ch.qos.logback.core.pattern.FormattingConverter.class.getName(),
            logger, Level.INFO, "Some message", ex, null);
  }
View Full Code Here

  LoggingEvent makeEvent(String msg) {
    return makeEvent(Level.DEBUG, msg, null, null);
  }

  LoggingEvent makeEvent(Level level, String msg, Throwable t, Object[] argArray) {
    return new LoggingEvent(this.getClass().getName(), logger, level, msg, t, argArray);
  }
View Full Code Here

    doEvaluateAndCheck("e.message == 'x'", event, true);
  }

  @Test
  public void msgRegex() throws EvaluationException {
    LoggingEvent event = makeEvent("Hello world");
    // partial match
    doEvaluateAndCheck("e.message =~ /xyz|wor/", event, true);
    // full match
    doEvaluateAndCheck("e.message ==~ /xyz|wor/", event, false);
  }
View Full Code Here

    doEvaluateAndCheck("e.message ==~ /xyz|wor/", event, false);
  }

  @Test
  public void level() throws EvaluationException {
    LoggingEvent event = makeEvent("x");
    doEvaluateAndCheck("e.level == DEBUG", event, true);
  }
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.