public class RewriteAppender
extends org.apache.log4j.AppenderSkeleton
implements org.apache.log4j.spi.AppenderAttachable, org.apache.log4j.xml.UnrecognizedElementHandler
Constructor and Description |
---|
RewriteAppender() |
Modifier and Type | Method and Description |
---|---|
void |
addAppender(org.apache.log4j.Appender newAppender)
Add appender.
|
protected void |
append(org.apache.log4j.spi.LoggingEvent event) |
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.
|
org.apache.log4j.Appender |
getAppender(String name)
Get appender by name.
|
boolean |
isAttached(org.apache.log4j.Appender appender)
Determines if specified appender is attached.
|
boolean |
parseUnrecognizedElement(Element element,
Properties props) |
void |
removeAllAppenders()
Removes and closes all attached appenders.
|
void |
removeAppender(org.apache.log4j.Appender appender)
Removes an appender.
|
void |
removeAppender(String name)
Remove appender by name.
|
boolean |
requiresLayout() |
void |
setRewritePolicy(RewritePolicy rewritePolicy) |
protected void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.AppenderSkeleton
public void addAppender(org.apache.log4j.Appender newAppender)
addAppender
in interface org.apache.log4j.spi.AppenderAttachable
newAppender
- appender to add, may not be null.public Enumeration getAllAppenders()
getAllAppenders
in interface org.apache.log4j.spi.AppenderAttachable
public org.apache.log4j.Appender getAppender(String name)
getAppender
in interface org.apache.log4j.spi.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 org.apache.log4j.Appender
public boolean isAttached(org.apache.log4j.Appender appender)
isAttached
in interface org.apache.log4j.spi.AppenderAttachable
appender
- appender.public boolean requiresLayout()
requiresLayout
in interface org.apache.log4j.Appender
public void removeAllAppenders()
removeAllAppenders
in interface org.apache.log4j.spi.AppenderAttachable
public void removeAppender(org.apache.log4j.Appender appender)
removeAppender
in interface org.apache.log4j.spi.AppenderAttachable
appender
- appender to remove.public void removeAppender(String name)
removeAppender
in interface org.apache.log4j.spi.AppenderAttachable
name
- name.public void setRewritePolicy(RewritePolicy rewritePolicy)
public boolean parseUnrecognizedElement(Element element, Properties props) throws Exception
parseUnrecognizedElement
in interface org.apache.log4j.xml.UnrecognizedElementHandler
Exception
Copyright © 2002-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.