Package io.debezium.junit.logging
Class LogInterceptor
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
io.debezium.junit.logging.LogInterceptor
- 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 LogInterceptor
extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
- Author:
- Chris Cranford, Jiri Pechanec
-
Field Summary
FieldsFields inherited from class ch.qos.logback.core.AppenderBase
name, startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor using root logger.LogInterceptor(Class<?> clazz) Provides a log interceptor based on the logger that emits the message.LogInterceptor(String loggerName) Provides a log interceptor based on the logger that emits the message. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappend(ch.qos.logback.classic.spi.ILoggingEvent loggingEvent) voidclear()booleancontainsErrorMessage(String text) private booleancontainsMessage(ch.qos.logback.classic.Level level, String text) booleancontainsMessage(String text) booleanbooleancontainsWarnMessage(String text) longcountOccurrences(String text) voidsetLoggerLevel(Class<?> loggerClass, ch.qos.logback.classic.Level level) Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, stop, toStringMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
events
-
-
Constructor Details
-
LogInterceptor
protected LogInterceptor()Constructor using root logger. This is usually not desirable as disabled additivity can prevent message to get here. -
LogInterceptor
Provides a log interceptor based on the logger that emits the message.- Parameters:
loggerName- logger that emits the log message
-
LogInterceptor
Provides a log interceptor based on the logger that emits the message.- Parameters:
clazz- class that emits the log message
-
-
Method Details
-
append
protected void append(ch.qos.logback.classic.spi.ILoggingEvent loggingEvent) - Specified by:
appendin classch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
setLoggerLevel
-
countOccurrences
-
containsMessage
-
containsWarnMessage
-
containsErrorMessage
-
containsStacktraceElement
-
clear
public void clear() -
containsMessage
-