|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.log4j.AppenderSkeleton org.apache.log4j.rewrite.RewriteAppender
public class RewriteAppender
This appender forwards a logging request to another appender after possibly rewriting the logging event. This appender (with the appropriate policy) replaces the MapFilter, PropertyFilter and ReflectionFilter from log4j 1.3.
Field Summary |
---|
Fields inherited from class org.apache.log4j.AppenderSkeleton |
---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
Constructor Summary | |
---|---|
RewriteAppender()
|
Method Summary | |
---|---|
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. |
Enumeration |
getAllAppenders()
Get iterator over attached appenders. |
Appender |
getAppender(String name)
Get appender by name. |
boolean |
isAttached(Appender appender)
Determines if specified appender is attached. |
boolean |
parseUnrecognizedElement(Element element,
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(String name)
Remove appender by name. |
boolean |
requiresLayout()
Configurators call this method to determine if the appender requires a layout. |
void |
setRewritePolicy(RewritePolicy rewritePolicy)
|
Methods inherited from class org.apache.log4j.AppenderSkeleton |
---|
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RewriteAppender()
Method Detail |
---|
protected void append(LoggingEvent event)
AppenderSkeleton
should implement this
method to perform actual logging. See also AppenderSkeleton.doAppend
method.
append
in class AppenderSkeleton
public void addAppender(Appender newAppender)
addAppender
in interface AppenderAttachable
newAppender
- appender to add, may not be null.public Enumeration getAllAppenders()
getAllAppenders
in interface AppenderAttachable
public Appender getAppender(String name)
getAppender
in interface AppenderAttachable
name
- name, may not be null.
public void close()
AsyncAppender
by interrupting the dispatcher
thread which will process all pending events before exiting.
close
in interface Appender
public boolean isAttached(Appender appender)
isAttached
in interface 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
in interface Appender
public void removeAllAppenders()
removeAllAppenders
in interface AppenderAttachable
public void removeAppender(Appender appender)
removeAppender
in interface AppenderAttachable
appender
- appender to remove.public void removeAppender(String name)
removeAppender
in interface AppenderAttachable
name
- name.public void setRewritePolicy(RewritePolicy rewritePolicy)
public boolean parseUnrecognizedElement(Element element, Properties props) throws Exception
parseUnrecognizedElement
in interface UnrecognizedElementHandler
element
- element, may not be null.props
- properties in force, may be null.
Exception
- throw an exception to prevent activation
of the configured object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |