LoggingEvent instance is created. This instance is passed around to the different logback-classic
components.
Writers of logback-classic components such as appenders should be aware of that some of the LoggingEvent fields are
initialized lazily. Therefore, an appender wishing to output data to be later correctly read by a receiver, must
initialize "lazy" fields prior to writing them out. See the prepareForDeferredProcessing() method for the
exact list.
| Modifier and Type | Field and Description |
|---|---|
| private transient Object[] | |
| private StackTraceElement[] | |
| pack-priv transient String | |
| pack-priv transient String | fqnOfLoggerClass
Fully qualified name of the calling Logger class. |
| private Instant | instant
The number of milliseconds elapsed from 1/1/1970 until logging event was created. |
| pack-priv List | |
| private transient Level | level
Level of logging event. |
| private LoggerContext | |
| private LoggerContextVO | |
| private String | |
| private List | |
| private Map | |
| private String | |
| private int | |
| public static final String | |
| private long | |
| private String | threadName
The name of thread in which this logging event was generated. |
| private ThrowableProxy | |
| private long | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private String | |
| private Throwable | |
| public Object[] | |
| public StackTraceElement[] | getCallerData()
Implements ch. |
| public long | |
| public String | |
| public Instant | getInstant()
Overrides default ch. Instant corresponding to the creation of this event.
|
| public List | getKeyValuePairs()
Implements ch. KeyValuePair objects.
|
| public Level | |
| public LoggerContextVO | |
| public String | |
| public List | getMarkerList()
Implements ch. |
| public Map | getMdc()
Implements ch.
Deprecated
Replaced by [@link #getMDCPropertyMap}
Synonym for [@link #getMDCPropertyMap}.
|
| public Map | getMDCPropertyMap()
Implements ch. |
| public String | |
| public int | getNanoseconds()
Implements ch. timestamp in seconds.
|
| public long | getSequenceNumber()
Implements ch. |
| public String | |
| public IThrowableProxy | getThrowableProxy()
Implements ch. |
| public long | getTimeStamp()
Implements ch. |
| pack-priv Long | Returns: Return the threadId if the thread is a virtual thread, return null otherwise.Return the threadId if running under JDK 21+ and the thread is a virtual thread, return null otherwise. |
| public boolean | hasCallerData()
Implements ch. |
| pack-priv void | |
| public void | prepareForDeferredProcessing()
Implements ch. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | |
| private void |
| argumentArray | back to summary |
|---|---|
| private transient Object[] argumentArray | |
| callerDataArray | back to summary |
|---|---|
| private StackTraceElement[] callerDataArray | |
| formattedMessage | back to summary |
|---|---|
| pack-priv transient String formattedMessage | |
| fqnOfLoggerClass | back to summary |
|---|---|
| pack-priv transient String fqnOfLoggerClass Fully qualified name of the calling Logger class. This field does not survive serialization.
Note that the getCallerInformation() method relies on this fact. | |
| instant | back to summary |
|---|---|
| private Instant instant The number of milliseconds elapsed from 1/1/1970 until logging event was created. | |
| keyValuePairs | back to summary |
|---|---|
pack-priv List<KeyValuePair> keyValuePairs
| |
| level | back to summary |
|---|---|
| private transient Level level Level of logging event.
This field should not be accessed directly. You should use the | |
| loggerContext | back to summary |
|---|---|
| private LoggerContext loggerContext | |
| loggerContextVO | back to summary |
|---|---|
| private LoggerContextVO loggerContextVO | |
| loggerName | back to summary |
|---|---|
| private String loggerName | |
| markerList | back to summary |
|---|---|
| private List<Marker> markerList | |
| mdcPropertyMap | back to summary |
|---|---|
| private Map<String, String> mdcPropertyMap | |
| message | back to summary |
|---|---|
| private String message | |
| nanoseconds | back to summary |
|---|---|
| private int nanoseconds | |
| REGULAR_UNNAMED_THREAD_PREFIX | back to summary |
|---|---|
| public static final String REGULAR_UNNAMED_THREAD_PREFIX | |
| sequenceNumber | back to summary |
|---|---|
| private long sequenceNumber | |
| threadName | back to summary |
|---|---|
| private String threadName The name of thread in which this logging event was generated. | |
| throwableProxy | back to summary |
|---|---|
| private ThrowableProxy throwableProxy | |
| timeStamp | back to summary |
|---|---|
| private long timeStamp | |
| VIRTUAL_THREAD_NAME_PREFIX | back to summary |
|---|---|
| public static final String VIRTUAL_THREAD_NAME_PREFIX | |
| LoggingEvent | back to summary |
|---|---|
| public LoggingEvent() | |
| LoggingEvent | back to summary |
|---|---|
| public LoggingEvent(String fqcn, Logger logger, Level level, String message, Throwable throwable, Object[] argArray) | |
| addKeyValuePair | back to summary |
|---|---|
| public void addKeyValuePair(KeyValuePair kvp) | |
| addMarker | back to summary |
|---|---|
| public void addMarker(Marker marker) | |
| extractThreadName | back to summary |
|---|---|
| private String extractThreadName(Thread aThread) Extracts the name of aThread by calling
| |
| extractThrowableAnRearrangeArguments | back to summary |
|---|---|
| private Throwable extractThrowableAnRearrangeArguments(Object[] argArray) | |
| getArgumentArray | back to summary |
|---|---|
| public Object[] getArgumentArray() Implements ch. | |
| getCallerData | back to summary |
|---|---|
| public StackTraceElement[] getCallerData() Implements ch. Get the caller information for this logging event. If caller information is null at the time of its invocation, this method extracts location information. The collected information is cached for future use.
Note that after serialization it is impossible to correctly extract caller information.
| |
| getContextBirthTime | back to summary |
|---|---|
| public long getContextBirthTime() | |
| getFormattedMessage | back to summary |
|---|---|
| public String getFormattedMessage() Implements ch. | |
| getInstant | back to summary |
|---|---|
| public Instant getInstant() Overrides default ch. Return the
| |
| getKeyValuePairs | back to summary |
|---|---|
| public List Implements ch. Doc from ch. A list of
| |
| getLevel | back to summary |
|---|---|
| public Level getLevel() Implements ch. | |
| getLoggerContextVO | back to summary |
|---|---|
| public LoggerContextVO getLoggerContextVO() Implements ch. | |
| getLoggerName | back to summary |
|---|---|
| public String getLoggerName() Implements ch. | |
| getMarkerList | back to summary |
|---|---|
| public List Implements ch. Doc from ch. Since SLF4J 2.0.0, the slf4j logging API assumes the possibility of multiple Marker instances in a logging event. Consequently, ILoggingEvent needs to cater for this possibility. | |
| getMdc | back to summary |
|---|---|
| public Map Implements ch. Deprecated Replaced by [@link #getMDCPropertyMap} Synonym for [@link #getMDCPropertyMap}. | |
| getMDCPropertyMap | back to summary |
|---|---|
| public Map Implements ch. Doc from ch. Returns the MDC map. The returned value can be an empty map but not null. | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Implements ch. | |
| getNanoseconds | back to summary |
|---|---|
| public int getNanoseconds() Implements ch. Return the number of nanoseconds past the
| |
| getSequenceNumber | back to summary |
|---|---|
| public long getSequenceNumber() Implements ch. Doc from ch. The sequence number associated with this event. Sequence numbers, if present, should be increasing monotonically.
| |
| getThreadName | back to summary |
|---|---|
| public String getThreadName() Implements ch. | |
| getThrowableProxy | back to summary |
|---|---|
| public IThrowableProxy getThrowableProxy() Implements ch. Returns the throwable information contained within this event. May be
| |
| getTimeStamp | back to summary |
|---|---|
| public long getTimeStamp() Implements ch. Return the number of elapsed milliseconds since epoch in UTC.
| |
| getVirtualThreadId | back to summary |
|---|---|
| pack-priv Long getVirtualThreadId(Thread aThread) Return the threadId if running under JDK 21+ and the thread is a virtual thread, return null otherwise.
| |
| hasCallerData | back to summary |
|---|---|
| public boolean hasCallerData() Implements ch. Doc from ch. If this event has caller data, then true is returned. Otherwise the returned value is null.
Logback components wishing to use caller data if available without causing it
to be computed can invoke this method before invoking
| |
| initTmestampFields | back to summary |
|---|---|
| pack-priv void initTmestampFields(Instant instant) | |
| prepareForDeferredProcessing | back to summary |
|---|---|
| public void prepareForDeferredProcessing() Implements ch. This method should be called prior to serializing an event. It should also be called when using asynchronous or deferred logging.
Note that due to performance concerns, this method does NOT extract caller data. It is the responsibility of the caller to extract caller information. | |
| setArgumentArray | back to summary |
|---|---|
| public void setArgumentArray(Object[] argArray) | |
| setCallerData | back to summary |
|---|---|
| public void setCallerData(StackTraceElement[] callerDataArray) | |
| setInstant | back to summary |
|---|---|
| public void setInstant(Instant instant) Set | |
| setKeyValuePairs | back to summary |
|---|---|
| public void setKeyValuePairs(List<KeyValuePair> kvpList) | |
| setLevel | back to summary |
|---|---|
| public void setLevel(Level level) | |
| setLoggerContext | back to summary |
|---|---|
| public void setLoggerContext(LoggerContext lc) | |
| setLoggerContextRemoteView | back to summary |
|---|---|
| public void setLoggerContextRemoteView(LoggerContextVO loggerContextVO) | |
| setLoggerName | back to summary |
|---|---|
| public void setLoggerName(String loggerName) | |
| setMDCPropertyMap | back to summary |
|---|---|
| public void setMDCPropertyMap(Map<String, String> map) Set the MDC map for this event.
| |
| setMessage | back to summary |
|---|---|
| public void setMessage(String message) | |
| setSequenceNumber | back to summary |
|---|---|
| public void setSequenceNumber(long sn) | |
| setThreadName | back to summary |
|---|---|
public void setThreadName(String threadName) throws IllegalStateException
| |
| setThrowableProxy | back to summary |
|---|---|
| public void setThrowableProxy(ThrowableProxy tp) Set this event's throwable information. | |
| setTimeStamp | back to summary |
|---|---|
| public void setTimeStamp(long timeStamp) Set the number of elapsed milliseconds since epoch in UTC.
Setting the timestamp will override the value contained in | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException LoggerEventVO instances should be used for serialization. Use
| |