public class ListAppender
extends org.apache.logging.log4j.core.appender.AbstractAppender
Appender implementation that captures LogRecords in a
thread-safe list.| Modifier | Constructor and Description |
|---|---|
protected |
ListAppender(java.lang.String name,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends java.io.Serializable> layout,
boolean ignoreExceptions,
org.apache.logging.log4j.core.config.Property[] properties)
Overridden constructor from log4j2 superclass.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(org.apache.logging.log4j.core.LogEvent event) |
static ListAppender |
create(java.lang.String name)
Create a new instance.
|
java.util.Spliterator<org.slf4j.event.LoggingEvent> |
spliterator()
Get the items.
|
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toStringaddFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, start, stop, stopequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stopprotected ListAppender(java.lang.String name,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends java.io.Serializable> layout,
boolean ignoreExceptions,
org.apache.logging.log4j.core.config.Property[] properties)
name - The Appender name.filter - The Filter to associate with the Appender.layout - The layout to use to format the event.ignoreExceptions - If true, exceptions will be logged and suppressed. If false
errors will be logged and then passed to the application.properties - The filter properties.public static ListAppender create(java.lang.String name)
name - The new appender's name within the Log4j2 context.public void append(org.apache.logging.log4j.core.LogEvent event)
public java.util.Spliterator<org.slf4j.event.LoggingEvent> spliterator()
Spliterator over the items.