org.apache.log.output
Class AsyncLogTarget
- Runnable, ErrorAware, LogTarget
public class AsyncLogTarget
implements Runnable
An asynchronous LogTarget that sends entries on in another thread.
It is the responsibility of the user of this class to start
the thread etc.
LogTarget mySlowTarget = ...;
AsyncLogTarget asyncTarget = new AsyncLogTarget( mySlowTarget );
Thread thread = new Thread( asyncTarget );
thread.setPriority( Thread.MIN_PRIORITY );
thread.start();
logger.setLogTargets( new LogTarget[] { asyncTarget } );
AsyncLogTarget
public AsyncLogTarget(LogTarget logTarget)
Creation of a new async log target.
logTarget
- the underlying target
AsyncLogTarget
public AsyncLogTarget(LogTarget logTarget,
int queueSize)
Creation of a new async log target.
logTarget
- the underlying targetqueueSize
- the queue size
run
public void run()
Thread startup.