Class RingBufferLogEventTranslator
- java.lang.Object
-
- org.apache.logging.log4j.core.async.RingBufferLogEventTranslator
-
- All Implemented Interfaces:
com.lmax.disruptor.EventTranslator<RingBufferLogEvent>
public class RingBufferLogEventTranslator extends java.lang.Object implements com.lmax.disruptor.EventTranslator<RingBufferLogEvent>
This class is responsible for writing elements that make up a log event into the ringbufferRingBufferLogEvent. After this translator populated the ringbuffer event, the disruptor will update the sequence number so that the event can be consumed by another thread.
-
-
Field Summary
Fields Modifier and Type Field Description private AsyncLoggerasyncLoggerprivate Clockclockprivate ThreadContext.ContextStackcontextStackprotected java.lang.Stringfqcnprivate static ContextDataInjectorINJECTORprotected Levellevelprivate java.lang.StackTraceElementlocation(package private) java.lang.StringloggerNameprotected Markermarkerprotected Messagemessageprivate NanoClocknanoClockprivate longthreadIdprivate java.lang.StringthreadNameprivate intthreadPriorityprotected java.lang.Throwablethrown
-
Constructor Summary
Constructors Constructor Description RingBufferLogEventTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclear()Release references held by this object to allow objects to be garbage-collected.voidsetBasicValues(AsyncLogger anAsyncLogger, java.lang.String aLoggerName, Marker aMarker, java.lang.String theFqcn, Level aLevel, Message msg, java.lang.Throwable aThrowable, ThreadContext.ContextStack aContextStack, java.lang.StackTraceElement aLocation, Clock aClock, NanoClock aNanoClock)voidtranslateTo(RingBufferLogEvent event, long sequence)voidupdateThreadValues()
-
-
-
Field Detail
-
INJECTOR
private static final ContextDataInjector INJECTOR
-
asyncLogger
private AsyncLogger asyncLogger
-
loggerName
java.lang.String loggerName
-
marker
protected Marker marker
-
fqcn
protected java.lang.String fqcn
-
level
protected Level level
-
message
protected Message message
-
thrown
protected java.lang.Throwable thrown
-
contextStack
private ThreadContext.ContextStack contextStack
-
threadId
private long threadId
-
threadName
private java.lang.String threadName
-
threadPriority
private int threadPriority
-
location
private java.lang.StackTraceElement location
-
clock
private Clock clock
-
nanoClock
private NanoClock nanoClock
-
-
Method Detail
-
translateTo
public void translateTo(RingBufferLogEvent event, long sequence)
- 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, java.lang.String aLoggerName, Marker aMarker, java.lang.String theFqcn, Level aLevel, Message msg, java.lang.Throwable aThrowable, ThreadContext.ContextStack aContextStack, java.lang.StackTraceElement aLocation, Clock aClock, NanoClock aNanoClock)
-
updateThreadValues
public void updateThreadValues()
-
-