public class AppenderAttachableImpl extends Object implements org.apache.log4j.spi.AppenderAttachable
AppenderAttachable interface.| Modifier and Type | Field and Description |
|---|---|
protected CopyOnWriteArrayList<org.apache.log4j.Appender> |
appenderList
Array of appenders.
|
| Constructor and Description |
|---|
AppenderAttachableImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAppender(org.apache.log4j.Appender newAppender)
Attach an appender.
|
int |
appendLoopOnAppenders(org.apache.log4j.spi.LoggingEvent event)
Call the
doAppend method on all attached appenders. |
void |
closeAppenders() |
Enumeration |
getAllAppenders()
Get all attached appenders as an Enumeration.
|
org.apache.log4j.Appender |
getAppender(String name)
Look for an attached appender named as
name. |
Iterable<org.apache.log4j.Appender> |
getAppenders() |
boolean |
isAttached(org.apache.log4j.Appender appender)
Returns
true if the specified appender is in the list of
attached appenders, false otherwise. |
void |
removeAllAppenders()
Remove and close all previously attached appenders.
|
void |
removeAppender(org.apache.log4j.Appender appender)
Remove the appender passed as parameter form the list of attached appenders.
|
void |
removeAppender(String name)
Remove the appender with the name passed as parameter form the list of
appenders.
|
protected final CopyOnWriteArrayList<org.apache.log4j.Appender> appenderList
public void addAppender(org.apache.log4j.Appender newAppender)
addAppender in interface org.apache.log4j.spi.AppenderAttachablepublic int appendLoopOnAppenders(org.apache.log4j.spi.LoggingEvent event)
doAppend method on all attached appenders.public void closeAppenders()
public Enumeration getAllAppenders()
null is returned.getAllAppenders in interface org.apache.log4j.spi.AppenderAttachablepublic Iterable<org.apache.log4j.Appender> getAppenders()
public org.apache.log4j.Appender getAppender(String name)
name.
Return the appender with that name if in the list. Return null otherwise.
getAppender in interface org.apache.log4j.spi.AppenderAttachablepublic boolean isAttached(org.apache.log4j.Appender appender)
true if the specified appender is in the list of
attached appenders, false otherwise.isAttached in interface org.apache.log4j.spi.AppenderAttachablepublic void removeAllAppenders()
removeAllAppenders in interface org.apache.log4j.spi.AppenderAttachablepublic void removeAppender(org.apache.log4j.Appender appender)
removeAppender in interface org.apache.log4j.spi.AppenderAttachablepublic void removeAppender(String name)
removeAppender in interface org.apache.log4j.spi.AppenderAttachableCopyright © 2006–2022 OPS4J - Open Participation Software for Java. All rights reserved.