public interface AsyncQueueFullPolicy
The asynchronous logging queue may become full when the application is logging faster than the underlying appender can keep up with for a long enough time to fill up the bounded queue. When this happens, the logging subsystem has to choose what to do with the event:
toString()
on a message
parameter, and the parameter object makes a logging call from its toString()
method.DefaultAsyncQueueFullPolicy
. The benefit of this approach is that
events will not get lost, but the disadvantage is that the resulting log file will be confusing for users,
since log events will appear in the log file in random order: new events that are directly logged are followed
by older log events taken from the queue.DiscardingAsyncQueueFullPolicy
for details.
See AsyncQueueFullPolicyFactory
for how to install a custom policy.
AsyncQueueFullPolicyFactory
Modifier and Type | Method and Description |
---|---|
EventRoute |
getRoute(long backgroundThreadId,
Level level)
Returns the appropriate route for the current log event, given the specified parameters.
|
EventRoute getRoute(long backgroundThreadId, Level level)
backgroundThreadId
- the thread ID of the background thread. Can be compared with the current thread's ID.level
- the level of the log event Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.