|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.log4j.AppenderSkeleton
Abstract super-class of the other appenders in the package. This class provides threashold filtering
Field Summary | |
protected boolean |
closed
Is this appender closed? |
protected ErrorHandler |
errorHandler
It is assumed and enforced that errorHandler is never null. |
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 Priority |
threshold
There is no priority threshold filtering by default. |
static String |
THRESHOLD_OPTION
A string constant used in naming the option for setting the threshold for the appender. |
Constructor Summary | |
AppenderSkeleton()
|
Method Summary | |
void |
activateOptions()
Derived appenders should override this method if option structure requires it. |
void |
addFilter(Filter newFilter)
Add a filter to end of the filter list. |
protected abstract void |
append(LoggingEvent event)
Subclasses of AppenderSkeleton should imlement 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 sub-classes specific append(org.log4j.spi.LoggingEvent) method. |
void |
finalize()
Finalize this appender by calling the imlenentation's close method. |
ErrorHandler |
getErrorHandler()
Return the currently set ErrorHandler for this
Appender. |
Filter |
getFirstFilter()
Return the first filter in the filter chain for this Appender. |
String |
getName()
Returns the name of this FileAppender. |
String[] |
getOptionStrings()
Returns the string array { THRESHOLD_OPTION }. |
boolean |
isAsSevereAsThreshold(Priority priority)
Check whether the message priority is below the appender's threshold. |
void |
setErrorHandler(ErrorHandler eh)
Set the ErrorHandler for this Appender. |
void |
setLayout(Layout layout)
Set the layout for this appender. |
void |
setName(String name)
Set the name of this Appender. |
void |
setOption(String key,
String value)
Configurable Appenders should override this method if they admit additional options. |
void |
setThreshold(Priority threshold)
Set the threshold priority. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.log4j.Appender |
close, requiresLayout |
Field Detail |
protected Layout layout
protected String name
protected Priority threshold
protected ErrorHandler errorHandler
protected Filter headFilter
null
initially.protected Filter tailFilter
protected boolean closed
public static final String THRESHOLD_OPTION
setThreshold
method. Current value of this string constant is
Threshold.
Note that all option keys are case sensitive.
Constructor Detail |
public AppenderSkeleton()
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 imlement this
method to perform actual logging. See also AppenderSkeleton.doAppend
method.public void clearFilters()
clearFilters
in interface Appender
public void finalize()
close
method.finalize
in class Object
public ErrorHandler getErrorHandler()
ErrorHandler
for this
Appender.public final Filter getFirstFilter()
null
if no is
filter is set.public final String getName()
getName
in interface Appender
public String[] getOptionStrings()
THRESHOLD_OPTION
}.
Configurable Appenders must override this method to return the additional options they accept.
getOptionStrings
in interface OptionHandler
public boolean isAsSevereAsThreshold(Priority priority)
true
.public void doAppend(LoggingEvent event)
append(org.log4j.spi.LoggingEvent)
method.doAppend
in interface Appender
public void setErrorHandler(ErrorHandler eh)
ErrorHandler
for this Appender.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 setOption(String key, String value)
AppenderSkeleton
admit the
Threshold option, that is the value of the string constant
THRESHOLD_OPTION
.
See setThreshold(org.log4j.Priority)
method for the meaning of this option.setOption
in interface OptionHandler
public void setThreshold(Priority threshold)
|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |