Log4j 1.3alpha-5

org.apache.log4j
Interface Appender

All Superinterfaces:
Component
All Known Implementing Classes:
AppenderSkeleton

public interface Appender
extends Component

Implement this interface for your own strategies for outputting log statements.

Author:
Ceki Gülcü

Method Summary
 void addFilter(Filter newFilter)
          Add a filter to the end of the filter list.
 void clearFilters()
          Clear the list of filters by removing all the filters in it.
 void close()
          Release any resources allocated within the appender such as file handles, network connections, etc.
 void doAppend(LoggingEvent event)
          Log in Appender specific way.
 Filter getFilter()
          Returns the head Filter.
 Layout getLayout()
          Returns this appenders layout.
 java.lang.String getName()
          Get the name of this appender.
 void setLayout(Layout layout)
          Set the Layout for this appender.
 void setLoggerRepository(LoggerRepository repository)
          Set owning logger repository for this component.
 void setName(java.lang.String name)
          Set the name of this appender.
 

Method Detail

addFilter

public void addFilter(Filter newFilter)
Add a filter to the end of the filter list.

Since:
0.9.0

getFilter

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.

Returns:
the head Filter or null, if no Filters are present
Since:
1.1

clearFilters

public void clearFilters()
Clear the list of filters by removing all the filters in it.

Since:
0.9.0

close

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.

Since:
0.8.4

doAppend

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.


getName

public java.lang.String getName()
Get the name of this appender. The name uniquely identifies the appender.


setLayout

public void setLayout(Layout layout)
Set the Layout for this appender.

Since:
0.8.1

getLayout

public Layout getLayout()
Returns this appenders layout.

Since:
1.1

setName

public void setName(java.lang.String name)
Set the name of this appender. The name is used by other components to identify this appender.

Since:
0.8.1

setLoggerRepository

public void setLoggerRepository(LoggerRepository repository)
                         throws java.lang.IllegalStateException
Description copied from interface: Component
Set owning logger repository for this component. This operation can only be performed once. Once set, the owning repository cannot be changed.

Specified by:
setLoggerRepository in interface Component
Parameters:
repository - The repository where this appender is attached.
Throws:
java.lang.IllegalStateException - If you try to change the repository after it has been set.

Log4j 1.3alpha-5

Copyright 2000-2005 Apache Software Foundation.