Class DefaultAsyncQueueFullPolicy

java.lang.Object
org.apache.logging.log4j.core.async.DefaultAsyncQueueFullPolicy
All Implemented Interfaces:
AsyncQueueFullPolicy
Direct Known Subclasses:
DiscardingAsyncQueueFullPolicy

public class DefaultAsyncQueueFullPolicy extends Object implements AsyncQueueFullPolicy
Default router: enqueue the event for asynchronous logging in the background thread, unless the current thread is the background thread and the queue is full (enqueueing would cause a deadlock). In that case send the event directly to the appender (in the current thread).
  • Constructor Details

    • DefaultAsyncQueueFullPolicy

      public DefaultAsyncQueueFullPolicy()
  • Method Details

    • getRoute

      public EventRoute getRoute(long backgroundThreadId, Level level)
      Description copied from interface: AsyncQueueFullPolicy
      Returns the appropriate route for the current log event, given the specified parameters.
      Specified by:
      getRoute in interface AsyncQueueFullPolicy
      Parameters:
      backgroundThreadId - the thread ID of the background thread. Can be compared with the current thread's ID.
      level - the level of the log event
      Returns:
      the appropriate route for the current event