public class DiscardingAsyncQueueFullPolicy extends DefaultAsyncQueueFullPolicy
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicLong |
discardCount |
private static Logger |
LOGGER |
private Level |
thresholdLevel |
Constructor and Description |
---|
DiscardingAsyncQueueFullPolicy(Level thresholdLevel)
Constructs a router that will discard events equal or less specific
than the specified threshold level when the queue is full.
|
Modifier and Type | Method and Description |
---|---|
static long |
getDiscardCount(AsyncQueueFullPolicy router) |
EventRoute |
getRoute(long backgroundThreadId,
Level level)
Returns the appropriate route for the current log event, given the specified parameters.
|
Level |
getThresholdLevel() |
private static final Logger LOGGER
private final Level thresholdLevel
private final java.util.concurrent.atomic.AtomicLong discardCount
public DiscardingAsyncQueueFullPolicy(Level thresholdLevel)
thresholdLevel
- level of events to discardpublic EventRoute getRoute(long backgroundThreadId, Level level)
AsyncQueueFullPolicy
getRoute
in interface AsyncQueueFullPolicy
getRoute
in class DefaultAsyncQueueFullPolicy
backgroundThreadId
- the thread ID of the background thread. Can be compared with the current thread's ID.level
- the level of the log eventpublic static long getDiscardCount(AsyncQueueFullPolicy router)
public Level getThresholdLevel()