|
Log4j 1.1b7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.log4j.AppenderSkeleton
Abstract super-class 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 |
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
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. |
| 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.apache.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 |
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. |
String[] |
getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed. |
Priority |
getThreshold()
Returns this appenders threshold priority. |
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)
Set option to value.
|
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.apache.log4j.Appender |
close, requiresLayout |
| Field Detail |
public static final String THRESHOLD_OPTION
setThreshold method. Current value of this string constant is
Threshold.protected Layout layout
protected String name
protected Priority threshold
protected ErrorHandler errorHandler
protected Filter headFilter
null
initially.protected Filter tailFilter
protected boolean closed
| Constructor Detail |
public AppenderSkeleton()
| Method Detail |
public void activateOptions()
activateOptions in interface OptionHandlerpublic void addFilter(Filter newFilter)
addFilter in interface Appenderprotected 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 Appenderpublic void finalize()
close method.finalize in class Objectpublic ErrorHandler getErrorHandler()
ErrorHandler for this
Appender.getErrorHandler in interface Appenderpublic Filter getFilter()
getFilter in interface Appenderpublic final Filter getFirstFilter()
null if no is
filter is set.public Layout getLayout()
getLayout in interface Appenderpublic final String getName()
getName in interface Appenderpublic String[] getOptionStrings()
THRESHOLD_OPTION}.
Configurable appenders must override this method to return the additional options they accept.
getOptionStrings in interface OptionHandlerpublic Priority getThreshold()
setThreshold(org.apache.log4j.Priority) method for the meaning of this option.public boolean isAsSevereAsThreshold(Priority priority)
true.public void doAppend(LoggingEvent event)
append(org.apache.log4j.spi.LoggingEvent) method.doAppend in interface Appenderpublic void setErrorHandler(ErrorHandler eh)
ErrorHandler for this Appender.setErrorHandler in interface Appenderpublic void setLayout(Layout layout)
SocketAppender ignores the layout set
here.setLayout in interface Appenderpublic void setName(String name)
setName in interface Appender
public void setOption(String key,
String value)
setOption method.
OptionHandleroption to value.
The handling of each option depends on the OptionHandler
instance. Some options may become active immediately whereas
other may be activated only when OptionHandler.activateOptions() is
called.
setOption in interface OptionHandlerpublic void setThreshold(Priority threshold)
In configuration files this option is specified by setting the value of the Threshold option to a priority string, such as "DEBUG", "INFO" and so on.
|
Log4j 1.1b7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||