Class LogbackTestUtil

java.lang.Object
com.reallifedeveloper.tools.test.LogbackTestUtil

public final class LogbackTestUtil extends Object
  • Field Details

    • LIST_APPENDER_NAME

      public static final String LIST_APPENDER_NAME
      The name of the ListAppender in the Logback configuration, logback-test.xml.
      See Also:
  • Method Details

    • getLoggingEvents

      public static List<ch.qos.logback.classic.spi.ILoggingEvent> getLoggingEvents()
      Gives a list of all logging events generated since startup or the latest call to clearLoggingEvents().

      This assumes that we are using Logback for logging, with a ch.qos.logback.core.read.ListAppender configured for the root logger.

      Returns:
      a list of logging events
    • clearLoggingEvents

      public static void clearLoggingEvents()
      Clears the list of logging events reteurned by getLoggingEvents().