org.apache.log4j
public class AsyncAppender extends AppenderSkeleton implements AppenderAttachable
AsyncAppender
can only be script
configured using the DOMConfigurator.
Since: 0.9.1
Field Summary | |
---|---|
static int | DEFAULT_BUFFER_SIZE
The default buffer size is set to 128 events. |
Constructor Summary | |
---|---|
AsyncAppender()
Create new instance. |
Method Summary | |
---|---|
void | addAppender(Appender newAppender)
Add appender.
|
void | append(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. |
Appender | getAppender(String name)
Get appender by name.
|
boolean | getBlocking()
Gets whether appender should block calling thread when buffer is full.
|
int | getBufferSize()
Gets the current buffer size. |
boolean | getLocationInfo()
Gets whether the location of the logging request call
should be captured.
|
boolean | isAttached(Appender appender)
Determines if specified appender is attached. |
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() |
void | setBlocking(boolean value)
Sets whether appender should wait if there is no
space available in the event buffer or immediately return.
|
void | setBufferSize(int size)
Sets the number of messages allowed in the event buffer
before the calling thread is blocked (if blocking is true)
or until messages are summarized and discarded. |
void | setLocationInfo(boolean flag)
The LocationInfo option takes a boolean value. |
Parameters: newAppender appender to add, may not be null.
AsyncAppender
by interrupting the dispatcher
thread which will process all pending events before exiting.Returns: iterator or null if no attached appenders.
Parameters: name name, may not be null.
Returns: matching appender or null.
Returns: true if calling thread will be blocked when buffer is full.
Returns: the current value of the BufferSize option.
Returns: the current value of the LocationInfo option.
Parameters: appender appender.
Returns: true if attached.
Parameters: appender appender to remove.
Parameters: name name.
Parameters: value true if appender should wait until available space in buffer.
Parameters: size buffer size, must be positive.
Parameters: flag true if location information should be extracted.