|
Log4j 1.3alpha-7 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.spi.ComponentBase
org.apache.log4j.AppenderSkeleton
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 boolean |
active
Is the appender ready for action. |
protected boolean |
closed
Is this appender closed? |
protected Filter |
headFilter
The first filter in the filter chain. |
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 Filter |
tailFilter
The last filter in the filter chain. |
protected Level |
threshold
There is no level threshold filtering by default. |
Fields inherited from class org.apache.log4j.spi.ComponentBase |
repository |
Constructor Summary | |
protected |
AppenderSkeleton()
Deprecated. Provided for compatibility, migrate to AppenderSkeleton(boolean) to indicate whether appender is ready upon construction. |
protected |
AppenderSkeleton(boolean isActive)
Construct an AppenderSkeleton. |
Method Summary | |
void |
activateOptions()
Called to configure appender for use after configuration. |
void |
addFilter(Filter newFilter)
Add a filter to end of the filter list. |
protected abstract void |
append(LoggingEvent event)
Subclasses of AppenderSkeleton should implement this method
to perform actual logging. |
void |
clearFilters()
Clear the filters chain. |
void |
doAppend(LoggingEvent event)
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific append(org.apache.log4j.spi.LoggingEvent) method. |
void |
finalize()
Finalize this appender by calling the derived class' close
method. |
ErrorHandler |
getErrorHandler()
Deprecated. As of 1.3 |
Filter |
getFilter()
Returns the head Filter. |
Filter |
getFirstFilter()
Return the first filter in the filter chain for this Appender. |
Layout |
getLayout()
Returns the layout of this appender. |
String |
getName()
Returns the name of this FileAppender. |
Level |
getThreshold()
Returns this appenders threshold level. |
boolean |
isActive()
Returns true if this appender is working order. |
boolean |
isAsSevereAsThreshold(Level level)
Check whether the message level is below the appender's threshold. |
boolean |
isClosed()
Returns true if this appender instance is closed. |
void |
setErrorHandler(ErrorHandler eh)
Deprecated. As of 1.3 |
void |
setLayout(Layout layout)
Set the layout for this appender. |
void |
setName(String name)
Set the name of this Appender. |
void |
setThreshold(Level threshold)
Set the threshold level. |
Methods inherited from class org.apache.log4j.spi.ComponentBase |
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.log4j.Appender |
close, setLoggerRepository |
Field Detail |
protected Layout layout
protected String name
protected Level threshold
protected Filter headFilter
null
initially.
protected Filter tailFilter
protected boolean closed
protected boolean active
Constructor Detail |
protected AppenderSkeleton()
protected AppenderSkeleton(boolean isActive)
isActive
- true if appender is ready for use upon construction.Method Detail |
public void activateOptions()
activateOptions
in interface OptionHandler
public void addFilter(Filter newFilter)
addFilter
in interface Appender
protected abstract void append(LoggingEvent event)
AppenderSkeleton
should implement this method
to perform actual logging. See also AppenderSkeleton.doAppend
method.
public void clearFilters()
clearFilters
in interface Appender
public void finalize()
close
method.
public final ErrorHandler getErrorHandler()
OnlyOnceErrorHandler
for this Appender.
ErrorHandler
's are no longer utilized as of version 1.3.
getErrorHandler
in interface Appender
public Filter getFilter()
getFilter
in interface Appender
public final Filter getFirstFilter()
null
if no is filter is set.
public Layout getLayout()
getLayout
in interface Appender
public final String getName()
getName
in interface Appender
public Level getThreshold()
setThreshold(org.apache.log4j.Level)
method for the meaning of this option.
public boolean isAsSevereAsThreshold(Level level)
true
.
public void doAppend(LoggingEvent event)
append(org.apache.log4j.spi.LoggingEvent)
method.
doAppend
in interface Appender
public boolean isClosed()
public boolean isActive()
public final void setErrorHandler(ErrorHandler eh)
setErrorHandler
in interface Appender
public void setLayout(Layout layout)
SocketAppender
ignores the layout set here.
setLayout
in interface Appender
public void setName(String name)
setName
in interface Appender
public void setThreshold(Level threshold)
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.
|
Log4j 1.3alpha-7 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |