|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.AppenderSkeleton
ariba.util.log.AsyncAppender
public class AsyncAppender
Basically cloned from log4j's AsyncAppender in log4j 1.2.8. Unfortunately that class was not designed to be overridden from outside its package, so it had to be duplicated. Key differences to provide robustness and error accounting: 1) The Dispatcher call to appendLoopOnAppenders(event) is now in a try/catch block so if an exception occurs in the filtering or appending (processing) of the event it doesn't kill the dispatcher. 2) When the exceptions mentioned in (1) occur, they are captured by AsyncAppender and available externally (see the xxxMessage(s) methods, below).
AsyncAppender
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size is set to 128 events. |
Constructor Summary | |
---|---|
AsyncAppender(boolean isConsoleWriteSuspended)
|
Method Summary | |
---|---|
void |
addAppender(org.apache.log4j.Appender newAppender)
|
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. |
java.util.Enumeration |
getAllAppenders()
|
org.apache.log4j.Appender |
getAppender(java.lang.String name)
|
int |
getBufferSize()
Returns the current value of the BufferSize option. |
boolean |
getLocationInfo()
Returns the current value of the LocationInfo option. |
boolean |
isAttached(org.apache.log4j.Appender appender)
Is the appender passed as parameter attached to this category? |
void |
removeAllAppenders()
|
void |
removeAppender(org.apache.log4j.Appender appender)
|
void |
removeAppender(java.lang.String name)
|
boolean |
requiresLayout()
The AsyncAppender does not require a layout. |
void |
setBufferSize(int size)
The BufferSize option takes a non-negative integer value. |
void |
setLocationInfo(boolean flag)
The LocationInfo option takes a boolean value. |
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
public AsyncAppender(boolean isConsoleWriteSuspended)
Method Detail |
---|
public void addAppender(org.apache.log4j.Appender newAppender)
public void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.AppenderSkeleton
public void close()
AsyncAppender
by interrupting the
dispatcher thread which will process all pending events before
exiting.
public java.util.Enumeration getAllAppenders()
public org.apache.log4j.Appender getAppender(java.lang.String name)
public boolean getLocationInfo()
public boolean isAttached(org.apache.log4j.Appender appender)
public boolean requiresLayout()
AsyncAppender
does not require a layout. Hence,
this method always returns false
.
public void removeAllAppenders()
public void removeAppender(org.apache.log4j.Appender appender)
public void removeAppender(java.lang.String name)
public void setLocationInfo(boolean flag)
Location information extraction is comparatively very slow and should be avoided unless performance is not a concern.
public void setBufferSize(int size)
default buffer size
because
configurators guarantee that an appender cannot be used before
being completely configured.
public int getBufferSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |