|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.AsyncLogTarget
public class AsyncLogTarget
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 } );
| Constructor Summary | |
|---|---|
AsyncLogTarget(LogTarget logTarget)
Creation of a new async log target. |
|
AsyncLogTarget(LogTarget logTarget,
int queueSize)
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. |
| Methods inherited from class org.apache.log.output.AbstractTarget |
|---|
close, error, getErrorHandler, isOpen, open, processEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncLogTarget(LogTarget logTarget)
logTarget - the underlying target
public AsyncLogTarget(LogTarget logTarget,
int queueSize)
logTarget - the underlying targetqueueSize - the queue size| Method Detail |
|---|
public void setErrorHandler(ErrorHandler errorHandler)
setErrorHandler in interface ErrorAwaresetErrorHandler in class AbstractTargeterrorHandler - the errorHandlerpublic void doProcessEvent(LogEvent event)
doProcessEvent in class AbstractTargetevent - the log eventpublic void run()
run in interface Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||