public class RewriteAppender extends AppenderSkeleton implements AppenderAttachable, UnrecognizedElementHandler
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
构造器和说明 |
---|
RewriteAppender() |
限定符和类型 | 方法和说明 |
---|---|
void |
addAppender(Appender newAppender)
Add appender.
|
protected void |
append(LoggingEvent event)
Subclasses of
AppenderSkeleton should implement this
method to perform actual logging. |
void |
close()
Close this
AsyncAppender by interrupting the dispatcher
thread which will process all pending events before exiting. |
java.util.Enumeration |
getAllAppenders()
Get iterator over attached appenders.
|
Appender |
getAppender(java.lang.String name)
Get appender by name.
|
boolean |
isAttached(Appender appender)
Determines if specified appender is attached.
|
boolean |
parseUnrecognizedElement(org.w3c.dom.Element element,
java.util.Properties props)
Called to inform a configured object when
an unrecognized child element is encountered.
|
void |
removeAllAppenders()
Removes and closes all attached appenders.
|
void |
removeAppender(Appender appender)
Removes an appender.
|
void |
removeAppender(java.lang.String name)
Remove appender by name.
|
boolean |
requiresLayout()
Configurators call this method to determine if the appender
requires a layout.
|
void |
setRewritePolicy(RewritePolicy rewritePolicy) |
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
protected void append(LoggingEvent event)
AppenderSkeleton
should implement this
method to perform actual logging. See also AppenderSkeleton.doAppend
method.append
在类中 AppenderSkeleton
public void addAppender(Appender newAppender)
addAppender
在接口中 AppenderAttachable
newAppender
- appender to add, may not be null.public java.util.Enumeration getAllAppenders()
getAllAppenders
在接口中 AppenderAttachable
public Appender getAppender(java.lang.String name)
getAppender
在接口中 AppenderAttachable
name
- name, may not be null.public void close()
AsyncAppender
by interrupting the dispatcher
thread which will process all pending events before exiting.public boolean isAttached(Appender appender)
isAttached
在接口中 AppenderAttachable
appender
- appender.public boolean requiresLayout()
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
.
requiresLayout
在接口中 Appender
public void removeAllAppenders()
removeAllAppenders
在接口中 AppenderAttachable
public void removeAppender(Appender appender)
removeAppender
在接口中 AppenderAttachable
appender
- appender to remove.public void removeAppender(java.lang.String name)
removeAppender
在接口中 AppenderAttachable
name
- name.public void setRewritePolicy(RewritePolicy rewritePolicy)
public boolean parseUnrecognizedElement(org.w3c.dom.Element element, java.util.Properties props) throws java.lang.Exception
parseUnrecognizedElement
在接口中 UnrecognizedElementHandler
element
- element, may not be null.props
- properties in force, may be null.java.lang.Exception
- throw an exception to prevent activation
of the configured object.