Save This Page
Home » apache-log4j-1.2.15 » org.apache » log4j » [javadoc | source]
org.apache.log4j
abstract public class: AppenderSkeleton [javadoc | source]
java.lang.Object
   org.apache.log4j.AppenderSkeleton

All Implemented Interfaces:
    OptionHandler, Appender

Direct Known Subclasses:
    TextPaneAppender, SyslogAppender, TelnetAppender, LF5Appender, DailyFileAppender, TempFileAppender, DatagramStringAppender, RollingFileAppender, JMSAppender, JDBCAppender, SocketAppender, FileAppender, NullAppender, CompositeRollingAppender, ConsoleAppender, ExternallyRolledFileAppender, SMTPAppender, AsyncAppender, DailyRollingFileAppender, NullAppender, TextPanelAppender, SocketHubAppender, JDBCAppender, NTEventLogAppender, WriterAppender

Abstract superclass of the other appenders in the package. This class provides the code for common functionality, such as support for threshold filtering and support for general filters.
Field Summary
protected  Layout layout    The layout variable does not need to be set if the appender implementation has its own layout. 
protected  String name    Appenders are named. 
protected  Priority threshold    There is no level threshold filtering by default. 
protected  ErrorHandler errorHandler    It is assumed and enforced that errorHandler is never null. 
protected  Filter headFilter    The first filter in the filter chain. Set to null initially. 
protected  Filter tailFilter    The last filter in the filter chain. 
protected  boolean closed    Is this appender closed? 
Constructor:
 public AppenderSkeleton() 
 protected AppenderSkeleton(boolean isActive) 
Method from org.apache.log4j.AppenderSkeleton Summary:
activateOptions,   addFilter,   append,   clearFilters,   doAppend,   finalize,   getErrorHandler,   getFilter,   getFirstFilter,   getLayout,   getName,   getThreshold,   isAsSevereAsThreshold,   setErrorHandler,   setLayout,   setName,   setThreshold
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.log4j.AppenderSkeleton Detail:
 public  void activateOptions() 
    Derived appenders should override this method if option structure requires it.
 public  void addFilter(Filter newFilter) 
    Add a filter to end of the filter list.
 abstract protected  void append(LoggingEvent event)
 public  void clearFilters() 
    Clear the filters chain.
 public synchronized  void doAppend(LoggingEvent event) 
    This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton#append method.
 public  void finalize() 
    Finalize this appender by calling the derived class' close method.
 public ErrorHandler getErrorHandler() 
 public Filter getFilter() 
    Returns the head Filter.
 public final Filter getFirstFilter() 
    Return the first filter in the filter chain for this Appender. The return value may be null if no is filter is set.
 public Layout getLayout() 
    Returns the layout of this appender. The value may be null.
 public final String getName() 
    Returns the name of this FileAppender.
 public Priority getThreshold() 
    Returns this appenders threshold level. See the #setThreshold method for the meaning of this option.
 public boolean isAsSevereAsThreshold(Priority priority) 
    Check whether the message level is below the appender's threshold. If there is no threshold set, then the return value is always true.
 public synchronized  void setErrorHandler(ErrorHandler eh) 
 public  void setLayout(Layout layout) 
    Set the layout for this appender. Note that some appenders have their own (fixed) layouts or do not use one. For example, the org.apache.log4j.net.SocketAppender ignores the layout set here.
 public  void setName(String name) 
    Set the name of this Appender.
 public  void setThreshold(Priority threshold) 
    Set the threshold level. All log events with lower level than the threshold level are ignored by the appender.

    In configuration files this option is specified by setting the value of the Threshold option to a level string, such as "DEBUG", "INFO" and so on.