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

    Fields
    Modifier and Type
    Field
    Description
    private 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
    Constructor
    Description
    Constructs a ListModelAppender.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    append(org.apache.log4j.spi.LoggingEvent event)
    void
    Removes all the Events from the model.
    void
    ListModel<org.apache.log4j.spi.LoggingEvent>
    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

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • model

      private final DefaultListModel<org.apache.log4j.spi.LoggingEvent> model
      Default list model.
  • Constructor Details

    • ListModelAppender

      public ListModelAppender()
      Constructs a ListModelAppender.
  • Method Details

    • getModel

      public 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.
      Returns:
      the list model
    • append

      protected void append(org.apache.log4j.spi.LoggingEvent event)
      Specified by:
      append in class org.apache.log4j.AppenderSkeleton
    • close

      public void close()
    • clearModel

      public void clearModel()
      Removes all the Events from the model.
    • requiresLayout

      public boolean requiresLayout()