Package org.elasticsearch.test
Class MockLogAppender
- java.lang.Object
-
- org.apache.logging.log4j.core.AbstractLifeCycle
-
- org.apache.logging.log4j.core.filter.AbstractFilterable
-
- org.apache.logging.log4j.core.appender.AbstractAppender
-
- org.elasticsearch.test.MockLogAppender
-
- All Implemented Interfaces:
org.apache.logging.log4j.core.Appender,org.apache.logging.log4j.core.filter.Filterable,org.apache.logging.log4j.core.LifeCycle,org.apache.logging.log4j.core.LifeCycle2
public class MockLogAppender extends org.apache.logging.log4j.core.appender.AbstractAppenderTest appender that can be used to verify that certain events were logged correctly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMockLogAppender.AbstractEventExpectationstatic classMockLogAppender.ExceptionSeenEventExpectationstatic interfaceMockLogAppender.LoggingExpectationstatic classMockLogAppender.PatternSeenEventExcpectationstatic classMockLogAppender.SeenEventExpectationstatic classMockLogAppender.UnseenEventExpectation
-
Constructor Summary
Constructors Constructor Description MockLogAppender()
-
Method Summary
Modifier and Type Method Description voidaddExpectation(MockLogAppender.LoggingExpectation expectation)voidappend(org.apache.logging.log4j.core.LogEvent event)voidassertAllExpectationsMatched()-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toSerializable, toString
-
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter, start, stop, stop
-
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
-
-
-
Method Detail
-
addExpectation
public void addExpectation(MockLogAppender.LoggingExpectation expectation)
-
append
public void append(org.apache.logging.log4j.core.LogEvent event)
-
assertAllExpectationsMatched
public void assertAllExpectationsMatched()
-
-