Class DiscardingAsyncQueueFullPolicy
java.lang.Object
org.apache.logging.log4j.core.async.DefaultAsyncQueueFullPolicy
org.apache.logging.log4j.core.async.DiscardingAsyncQueueFullPolicy
- All Implemented Interfaces:
AsyncQueueFullPolicy
Discarding router extends the DefaultAsyncQueueFullPolicy by first verifying if the queue is fuller than the specified
threshold ratio; if this is the case, log events more specific than
the specified threshold level are dropped. If this is not the case, the default routing rules hold.
-
Constructor Summary
ConstructorDescriptionDiscardingAsyncQueueFullPolicy
(Level thresholdLevel) Constructs a router that will discard events equal or less specific than the specified threshold level when the queue is full. -
Method Summary
Modifier and TypeMethodDescriptionstatic long
getDiscardCount
(AsyncQueueFullPolicy router) Returns the appropriate route for the current log event, given the specified parameters.
-
Constructor Details
-
DiscardingAsyncQueueFullPolicy
Constructs a router that will discard events equal or less specific than the specified threshold level when the queue is full.- Parameters:
thresholdLevel
- level of events to discard
-
-
Method Details
-
getRoute
Description copied from interface:AsyncQueueFullPolicy
Returns the appropriate route for the current log event, given the specified parameters.- Specified by:
getRoute
in interfaceAsyncQueueFullPolicy
- Overrides:
getRoute
in classDefaultAsyncQueueFullPolicy
- 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
-
getDiscardCount
-
getThresholdLevel
-