LogTarget mySlowTarget = ...;
AsyncLogTarget asyncTarget = new AsyncLogTarget( mySlowTarget );
Thread thread = new Thread( asyncTarget );
thread.setPriority( Thread.MIN_PRIORITY );
thread.start();
logger.setLogTargets( new LogTarget[] { asyncTarget } );
| Modifier and Type | Field and Description |
|---|---|
| private final LinkedList | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | AsyncLogTarget(final LogTarget
the underlying target logTarget, final int the queue size queueSize)Creation of a new async log target. |
| public | AsyncLogTarget(final LogTarget
the underlying target logTarget, final boolean close the underlying target when this target is closed. This flag
has no effect unless the logTarget implements Closeable. closeTarget)Creation of a new async log target. |
| public | AsyncLogTarget(final LogTarget
the underlying target logTarget, final int the queue size queueSize, final boolean close the underlying target when this target is closed. This flag
has no effect unless the logTarget implements Closeable. closeTarget)Creation of a new async log target. |
| Modifier and Type | Method and Description |
|---|---|
| public void | doProcessEvent(final LogEvent
the log event event)Implements abstract org. |
| public void | |
| public synchronized void | setErrorHandler(final ErrorHandler
the errorHandler errorHandler)Overrides org. Implements org. |
| m_list | back to summary |
|---|---|
| private final LinkedList<E> m_list | |
| m_queueSize | back to summary |
|---|---|
| private final int m_queueSize | |
| AsyncLogTarget | back to summary |
|---|---|
| public AsyncLogTarget(final LogTarget logTarget) Creation of a new async log target.
| |
| AsyncLogTarget | back to summary |
|---|---|
| public AsyncLogTarget(final LogTarget logTarget, final int queueSize) Creation of a new async log target.
| |
| AsyncLogTarget | back to summary |
|---|---|
| public AsyncLogTarget(final LogTarget logTarget, final boolean closeTarget) Creation of a new async log target.
| |
| AsyncLogTarget | back to summary |
|---|---|
| public AsyncLogTarget(final LogTarget logTarget, final int queueSize, final boolean closeTarget) Creation of a new async log target.
| |
| doProcessEvent | back to summary |
|---|---|
| public void doProcessEvent(final LogEvent event) Implements abstract org. Process a log event by adding it to queue.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Thread startup. | |
| setErrorHandler | back to summary |
|---|---|
| public synchronized void setErrorHandler(final ErrorHandler errorHandler) Overrides org. Implements org. Provide component with ErrorHandler.
| |