public interface ThreadFactory
Appenders are constructed with an instance of DefaultThreadFactory
(or perhaps an appender-specific factory), and lazily call this factory on
first append. The thread is not returned by the factory; it should exit
normally when the appender calls LogWriter.stop().
To handle unexpected thread death, the appender must provide an uncaught exception handler. A typical handler will log the event using Log4J's internal logger, and then create a new writer.
In the test helpers, you will find MockThreadFactory, which does
not actually start a thread.
| Modifier and Type | Method and Description |
|---|---|
void |
startLoggingThread(LogWriter writer,
Thread.UncaughtExceptionHandler exceptionHandler) |
void startLoggingThread(LogWriter writer, Thread.UncaughtExceptionHandler exceptionHandler)
Copyright © 2018. All rights reserved.