Save This Page
Home » slf4j-1.5.5 » org.apache » log4j » [javadoc | source]
org.apache.log4j
public interface: Appender [javadoc | source]

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

Implement this interface for your own strategies for outputting log statements.
Method from org.apache.log4j.Appender Summary:
addFilter,   clearFilters,   close,   doAppend,   getErrorHandler,   getFilter,   getLayout,   getName,   requiresLayout,   setErrorHandler,   setLayout,   setName
Method from org.apache.log4j.Appender Detail:
 public  void addFilter(Filter newFilter)
    Add a filter to the end of the filter list.
 public  void clearFilters()
    Clear the list of filters by removing all the filters in it.
 public  void close()
    Release any resources allocated within the appender such as file handles, network connections, etc.

    It is a programming error to append to a closed appender.

 public  void doAppend(LoggingEvent event)
    Log in Appender specific way. When appropriate, Loggers will call the doAppend method of appender implementations in order to log.
 public ErrorHandler getErrorHandler()
 public Filter getFilter()
    Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result.
 public Layout getLayout()
    Returns this appenders layout.
 public String getName()
    Get the name of this appender. The name uniquely identifies the appender.
 public boolean requiresLayout()
    Configurators call this method to determine if the appender requires a layout. If this method returns true, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator..

    In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.

 public  void setErrorHandler(ErrorHandler errorHandler)
 public  void setLayout(Layout layout)
    Set the Layout for this appender.
 public  void setName(String name)
    Set the name of this appender. The name is used by other components to identify this appender.