public class ReusableLogEventFactory extends java.lang.Object implements LogEventFactory, LocationAwareLogEventFactory
Modifier and Type | Field and Description |
---|---|
private static Clock |
CLOCK |
private ContextDataInjector |
injector |
private static java.lang.ThreadLocal<MutableLogEvent> |
mutableLogEventThreadLocal |
private static ThreadNameCachingStrategy |
THREAD_NAME_CACHING_STRATEGY |
Constructor and Description |
---|
ReusableLogEventFactory() |
Modifier and Type | Method and Description |
---|---|
LogEvent |
createEvent(java.lang.String loggerName,
Marker marker,
java.lang.String fqcn,
Level level,
Message message,
java.util.List<Property> properties,
java.lang.Throwable t)
Creates a log event.
|
LogEvent |
createEvent(java.lang.String loggerName,
Marker marker,
java.lang.String fqcn,
java.lang.StackTraceElement location,
Level level,
Message message,
java.util.List<Property> properties,
java.lang.Throwable t)
Creates a log event.
|
static void |
release(LogEvent logEvent)
Switches the
reserved flag off if the specified event is a MutableLogEvent, otherwise does nothing. |
private static final ThreadNameCachingStrategy THREAD_NAME_CACHING_STRATEGY
private static final Clock CLOCK
private static java.lang.ThreadLocal<MutableLogEvent> mutableLogEventThreadLocal
private final ContextDataInjector injector
public LogEvent createEvent(java.lang.String loggerName, Marker marker, java.lang.String fqcn, Level level, Message message, java.util.List<Property> properties, java.lang.Throwable t)
createEvent
in interface LogEventFactory
loggerName
- The name of the Logger.marker
- An optional Marker.fqcn
- The fully qualified class name of the caller.level
- The event Level.message
- The Message.properties
- Properties to be added to the log event.t
- An optional Throwable.public LogEvent createEvent(java.lang.String loggerName, Marker marker, java.lang.String fqcn, java.lang.StackTraceElement location, Level level, Message message, java.util.List<Property> properties, java.lang.Throwable t)
createEvent
in interface LocationAwareLogEventFactory
loggerName
- The name of the Logger.marker
- An optional Marker.fqcn
- The fully qualified class name of the caller.location
- The location of the caller.level
- The event Level.message
- The Message.properties
- Properties to be added to the log event.t
- An optional Throwable.public static void release(LogEvent logEvent)
reserved
flag off if the specified event is a MutableLogEvent, otherwise does nothing.
This flag is used internally to verify that a reusable log event is no longer in use and can be reused.logEvent
- the log event to make available again