Package org.apache.log4j.varia
Class ListModelAppender
java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.varia.ListModelAppender
- All Implemented Interfaces:
org.apache.log4j.Appender
,org.apache.log4j.spi.OptionHandler
public final class ListModelAppender
extends org.apache.log4j.AppenderSkeleton
A very basic appender that takes the events and stores them in to a
ListModel for late retrieval.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DefaultListModel<org.apache.log4j.spi.LoggingEvent>
Default list model.Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
append
(org.apache.log4j.spi.LoggingEvent event) void
Removes all the Events from the model.void
close()
ListModel<org.apache.log4j.spi.LoggingEvent>
getModel()
Returns a reference to the ListModel that contains all the LoggingEvents that have been appended to this class.boolean
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
-
Field Details
-
model
Default list model.
-
-
Constructor Details
-
ListModelAppender
public ListModelAppender()Constructs a ListModelAppender.
-
-
Method Details
-
getModel
Returns a reference to the ListModel that contains all the LoggingEvents that have been appended to this class.- Returns:
- the list model
-
append
protected void append(org.apache.log4j.spi.LoggingEvent event) - Specified by:
append
in classorg.apache.log4j.AppenderSkeleton
-
close
public void close() -
clearModel
public void clearModel()Removes all the Events from the model. -
requiresLayout
public boolean requiresLayout()
-