org.apache.log.output
public class AsyncLogTarget extends AbstractWrappingTarget implements Runnable
LogTarget mySlowTarget = ...; AsyncLogTarget asyncTarget = new AsyncLogTarget( mySlowTarget ); Thread thread = new Thread( asyncTarget ); thread.setPriority( Thread.MIN_PRIORITY ); thread.start(); logger.setLogTargets( new LogTarget[] { asyncTarget } );
Field Summary | |
---|---|
LinkedList | m_list |
int | m_queueSize |
Constructor Summary | |
---|---|
AsyncLogTarget(LogTarget logTarget)
Creation of a new async log target. | |
AsyncLogTarget(LogTarget logTarget, int queueSize)
Creation of a new async log target. | |
AsyncLogTarget(LogTarget logTarget, boolean closeTarget)
Creation of a new async log target. | |
AsyncLogTarget(LogTarget logTarget, int queueSize, boolean closeTarget)
Creation of a new async log target. |
Method Summary | |
---|---|
void | doProcessEvent(LogEvent event)
Process a log event by adding it to queue.
|
void | run()
Thread startup. |
void | setErrorHandler(ErrorHandler errorHandler)
Provide component with ErrorHandler.
|
Parameters: logTarget the underlying target
Parameters: logTarget the underlying target queueSize the queue size
Parameters: logTarget the underlying target closeTarget close the underlying target when this target is closed. This flag has no effect unless the logTarget implements Closeable.
Parameters: logTarget the underlying target queueSize the queue size closeTarget close the underlying target when this target is closed. This flag has no effect unless the logTarget implements Closeable.
Parameters: event the log event
Parameters: errorHandler the errorHandler