public class AsyncAppenderWithStorage
extends org.apache.log4j.AsyncAppender
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_STORAGE_SIZE
Default buffer size.
|
Constructor and Description |
---|
AsyncAppenderWithStorage()
Create a AsyncAppenderWithStorage with default parameters.
|
AsyncAppenderWithStorage(int bufferSize)
Create a AsyncAppenderWithStorage.
|
AsyncAppenderWithStorage(String name)
Create a AsyncAppenderWithStorage.
|
AsyncAppenderWithStorage(String name,
int storageSize)
Create a AsyncAppenderWithStorage.
|
Modifier and Type | Method and Description |
---|---|
void |
addAppender(org.apache.log4j.Appender newAppender)
When an appender is added, then the content of the storage is append into
the added appender.
|
void |
append(org.apache.log4j.spi.LoggingEvent event) |
void |
appendStoredEvents(org.apache.log4j.Appender appender)
Append stored events to the given appender.
|
void |
close() |
LinkedList<org.apache.log4j.spi.LoggingEvent> |
getStorage()
Return a clone of the current logging event storage.
|
boolean |
requiresLayout() |
getAllAppenders, getAppender, getBlocking, getBufferSize, getLocationInfo, isAttached, removeAllAppenders, removeAppender, removeAppender, setBlocking, setBufferSize, setLocationInfo
public static final int DEFAULT_STORAGE_SIZE
public AsyncAppenderWithStorage()
public AsyncAppenderWithStorage(int bufferSize)
bufferSize
- the size of the buffer. If the buffer is full,
logs events are stored in FIFO manner.public AsyncAppenderWithStorage(String name)
name
- the name of the appender.
activatedpublic AsyncAppenderWithStorage(String name, int storageSize)
name
- the name of the appender.storageSize
- the size of the buffer. If the buffer is full,
logs events are stored in FIFO manner.
activatedpublic void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.AsyncAppender
public void addAppender(org.apache.log4j.Appender newAppender)
addAppender
in interface org.apache.log4j.spi.AppenderAttachable
addAppender
in class org.apache.log4j.AsyncAppender
AsyncAppender.addAppender(org.apache.log4j.Appender)
public void appendStoredEvents(org.apache.log4j.Appender appender)
public LinkedList<org.apache.log4j.spi.LoggingEvent> getStorage()
public void close()
close
in interface org.apache.log4j.Appender
close
in class org.apache.log4j.AsyncAppender
Appender.close()
public boolean requiresLayout()
requiresLayout
in interface org.apache.log4j.Appender
requiresLayout
in class org.apache.log4j.AsyncAppender
Appender.requiresLayout()