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.AbstractAppender
Test appender that can be used to verify that certain events were logged correctly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MockLogAppender.AbstractEventExpectation
static class
MockLogAppender.ExceptionSeenEventExpectation
static interface
MockLogAppender.LoggingExpectation
static class
MockLogAppender.PatternSeenEventExpectation
static class
MockLogAppender.SeenEventExpectation
static class
MockLogAppender.UnseenEventExpectation
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MockLogAppender()
-
Method Summary
Modifier and Type Method Description void
addExpectation(MockLogAppender.LoggingExpectation expectation)
void
append(org.apache.logging.log4j.core.LogEvent event)
void
assertAllExpectationsMatched()
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
-
Constructor Details
-
MockLogAppender
public MockLogAppender() throws java.lang.IllegalAccessException- Throws:
java.lang.IllegalAccessException
-
-
Method Details
-
addExpectation
-
append
public void append(org.apache.logging.log4j.core.LogEvent event) -
assertAllExpectationsMatched
public void assertAllExpectationsMatched()
-