Class RingBufferLogEventTranslator
java.lang.Object
org.apache.logging.log4j.core.async.RingBufferLogEventTranslator
- All Implemented Interfaces:
com.lmax.disruptor.EventTranslator<RingBufferLogEvent>
public class RingBufferLogEventTranslator
extends Object
implements com.lmax.disruptor.EventTranslator<RingBufferLogEvent>
This class is responsible for writing elements that make up a log event into
the ringbuffer
RingBufferLogEvent. After this translator populated
the ringbuffer event, the disruptor will update the sequence number so that
the event can be consumed by another thread.
Usage note: This class is only used on the thread that created it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AsyncLoggerprivate Clockprivate ThreadContext.ContextStackprotected Stringprivate static final ContextDataInjectorprotected Levelprivate StackTraceElement(package private) Stringprotected Markerprotected Messageprivate NanoClockprivate longprivate Stringprivate intprotected Throwable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidclear()Release references held by this object to allow objects to be garbage-collected.voidsetBasicValues(AsyncLogger anAsyncLogger, String aLoggerName, Marker aMarker, String theFqcn, Level aLevel, Message msg, Throwable aThrowable, ThreadContext.ContextStack aContextStack, StackTraceElement aLocation, Clock aClock, NanoClock aNanoClock) voidtranslateTo(RingBufferLogEvent event, long sequence) voidDeprecated.since 2.25.0.
-
Field Details
-
INJECTOR
-
asyncLogger
-
loggerName
String loggerName -
marker
-
fqcn
-
level
-
message
-
thrown
-
contextStack
-
location
-
clock
-
nanoClock
-
threadId
private long threadId -
threadName
-
threadPriority
private int threadPriority
-
-
Constructor Details
-
RingBufferLogEventTranslator
public RingBufferLogEventTranslator()
-
-
Method Details
-
translateTo
- Specified by:
translateToin interfacecom.lmax.disruptor.EventTranslator<RingBufferLogEvent>
-
clear
void clear()Release references held by this object to allow objects to be garbage-collected. -
setBasicValues
public void setBasicValues(AsyncLogger anAsyncLogger, String aLoggerName, Marker aMarker, String theFqcn, Level aLevel, Message msg, Throwable aThrowable, ThreadContext.ContextStack aContextStack, StackTraceElement aLocation, Clock aClock, NanoClock aNanoClock) -
updateThreadValues
Deprecated.since 2.25.0.RingBufferLogEventTranslatorinstances should only be used on the thread that created it.
-