Interface AsyncLoggerConfigDelegate
- All Known Implementing Classes:
AsyncLoggerConfigDisruptor
public interface AsyncLoggerConfigDelegate
Encapsulates the mechanism used to log asynchronously. There is one delegate per configuration, which is shared by
all AsyncLoggerConfig objects in the configuration.
-
Method Summary
Modifier and TypeMethodDescriptioncreateRingBufferAdmin(String contextName, String loggerConfigName) Creates and returns a newRingBufferAdminthat instruments the ringbuffer of thisAsyncLoggerConfig.voidenqueueEvent(LogEvent event, AsyncLoggerConfig asyncLoggerConfig) Enqueues theLogEventon the mixed configuration ringbuffer.getEventRoute(Level level) Returns theEventRoutefor the event with the specified level.voidsetLogEventFactory(LogEventFactory logEventFactory) Notifies the delegate what LogEventFactory an AsyncLoggerConfig is using, so the delegate can determine whether to populate the ring buffer with mutable log events or not.booleantryEnqueue(LogEvent event, AsyncLoggerConfig asyncLoggerConfig)
-
Method Details
-
createRingBufferAdmin
Creates and returns a newRingBufferAdminthat instruments the ringbuffer of thisAsyncLoggerConfig.- Parameters:
contextName- name of theLoggerContextloggerConfigName- name of the logger config- Returns:
- the RingBufferAdmin that instruments the ringbuffer
-
getEventRoute
Returns theEventRoutefor the event with the specified level.- Parameters:
level- the level of the event to log- Returns:
- the
EventRoute
-
enqueueEvent
Enqueues theLogEventon the mixed configuration ringbuffer. This method must only be used aftertryEnqueue(LogEvent, AsyncLoggerConfig)returnsfalseindicating that the ringbuffer is full, otherwise it may incur unnecessary synchronization. -
tryEnqueue
-
setLogEventFactory
Notifies the delegate what LogEventFactory an AsyncLoggerConfig is using, so the delegate can determine whether to populate the ring buffer with mutable log events or not. This method may be invoked multiple times for all AsyncLoggerConfigs that use this delegate.- Parameters:
logEventFactory- the factory used
-