Class CapturingAppender
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
- akka.actor.testkit.typed.internal.CapturingAppender
-
- All Implemented Interfaces:
ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>
,ch.qos.logback.core.spi.ContextAware
,ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>
,ch.qos.logback.core.spi.LifeCycle
public class CapturingAppender extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
INTERNAL APILogging from tests can be silenced by this appender. When there is a test failure the captured logging events are flushed to the appenders defined for the akka.actor.testkit.typed.internal.CapturingAppenderDelegate logger.
The flushing on test failure is handled by
LogCapturing
for ScalaTest andLogCapturing
for JUnit.Use configuration like the following the logback-test.xml:
<appender name="CapturingAppender" class="akka.actor.testkit.typed.internal.CapturingAppender" /> <logger name="akka.actor.testkit.typed.internal.CapturingAppenderDelegate" > <appender-ref ref="STDOUT"/> </logger> <root level="DEBUG"> <appender-ref ref="CapturingAppender"/> </root>
-
-
Constructor Summary
Constructors Constructor Description CapturingAppender()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(ch.qos.logback.classic.spi.ILoggingEvent event)
void
clear()
Discards the buffered logging events without output.void
flush()
Flush buffered logging events to the output appenders Also clears the buffer..static CapturingAppender
get(java.lang.String loggerName)
-
Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, stop, toString
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Method Detail
-
get
public static CapturingAppender get(java.lang.String loggerName)
-
append
public void append(ch.qos.logback.classic.spi.ILoggingEvent event)
- Specified by:
append
in classch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
flush
public void flush()
Flush buffered logging events to the output appenders Also clears the buffer..
-
clear
public void clear()
Discards the buffered logging events without output.
-
-