Top Description Methods
ch.qos.logback.classic.spi

public Interface ILoggingEvent

extends DeferredProcessingAware
Known Direct Implementers
ch.qos.logback.classic.spi.LoggingEvent, ch.qos.logback.classic.spi.LoggingEventVO
Imports
java.time.Instant, java.util.List, .Map, org.slf4j.Marker, org.slf4j.event.KeyValuePair, ch.qos.logback.classic.Level, ch.qos.logback.core.spi.DeferredProcessingAware

The central interface in logback-classic. In a nutshell, logback-classic is nothing more than a processing chain built around this interface.
Author
Ceki Gülcü
Since
0.9.16

Method Summary

Modifier and TypeMethod and Description
public Object[]
public StackTraceElement[]

Returns:

the caller data associated with this event.
getCallerData
()

Return caller data associated with this event.

public String
public default Instant

Returns:

the Instant the event was created.
getInstant
()

Return the Instant the event was created.

public List<KeyValuePair>

Returns:

may be null
getKeyValuePairs
()

A list of KeyValuePair objects.

public Level
public LoggerContextVO
public String
public default Marker

Returns:

the first marker in the marker list or null if no markers are available
getMarker
()

Deprecated Replaced by getMarkerList()
Returns the first marker is the marker list or null if no markers are available.
public List<Marker>

Returns:

the marker list, may be null
getMarkerList
()

Since SLF4J 2.0.0, the slf4j logging API assumes the possibility of multiple Marker instances in a logging event.

public Map<String, String>
getMdc()

Deprecated Replaced by [@link #getMDCPropertyMap}
Synonym for [@link #getMDCPropertyMap}.
public Map<String, String>
getMDCPropertyMap()

Returns the MDC map.

public String
public int

Returns:

the number of elapsed nanoseconds as found in getInstant()
getNanoseconds
()

Return the number of elapsed nanoseconds found in getInstant() May return -1 if data unavailable.

public long
getSequenceNumber()

The sequence number associated with this event.

public String
public IThrowableProxy
public long

Returns:

the number of elapsed milliseconds since epoch
getTimeStamp
()

Return the number of elapsed milliseconds since epoch.

public boolean

Returns:

whether this event has caller data
hasCallerData
()

If this event has caller data, then true is returned.

public void

Method Detail

getArgumentArrayback to summary
public Object[] getArgumentArray()
getCallerDataback to summary
public StackTraceElement[] getCallerData()

Return caller data associated with this event. Note that calling this event may trigger the computation of caller data.

Returns:StackTraceElement[]

the caller data associated with this event.

See Also
hasCallerData()
getFormattedMessageback to summary
public String getFormattedMessage()
getInstantback to summary
public default Instant getInstant()

Return the Instant the event was created. Default implementation returns the instant corresponding to the value returned by @link getTimeStamp().

Returns:Instant

the Instant the event was created.

Since
1.3
getKeyValuePairsback to summary
public List<KeyValuePair> getKeyValuePairs()

A list of KeyValuePair objects. The returned list may be null.

Returns:List<KeyValuePair>

may be null

Since
1.3.0
getLevelback to summary
public Level getLevel()
getLoggerContextVOback to summary
public LoggerContextVO getLoggerContextVO()
getLoggerNameback to summary
public String getLoggerName()
getMarkerback to summary
public default Marker getMarker()

Deprecated

Replaced by getMarkerList()

Returns the first marker is the marker list or null if no markers are available. This method is deprecated and exists solely for backward compatibility reasons. Logback components should use getMarkerList() and cater for all available markers and not only the first one.

Returns:Marker

the first marker in the marker list or null if no markers are available

getMarkerListback to summary
public List<Marker> getMarkerList()

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.

Returns:List<Marker>

the marker list, may be null

Since
1.3.0
getMdcback to summary
public Map<String, String> getMdc()

Deprecated

Replaced by [@link #getMDCPropertyMap}

Synonym for [@link #getMDCPropertyMap}.

getMDCPropertyMapback to summary
public Map<String, String> getMDCPropertyMap()

Returns the MDC map. The returned value can be an empty map but not null.

getMessageback to summary
public String getMessage()
getNanosecondsback to summary
public int getNanoseconds()

Return the number of elapsed nanoseconds found in getInstant() May return -1 if data unavailable.

Returns:int

the number of elapsed nanoseconds as found in getInstant()

Since
1.3
getSequenceNumberback to summary
public long getSequenceNumber()

The sequence number associated with this event.

Sequence numbers, if present, should be increasing monotonically.

Since
1.3.0
getThreadNameback to summary
public String getThreadName()
getThrowableProxyback to summary
public IThrowableProxy getThrowableProxy()
getTimeStampback to summary
public long getTimeStamp()

Return the number of elapsed milliseconds since epoch.

Returns:long

the number of elapsed milliseconds since epoch

Since
1.3
hasCallerDataback to summary
public boolean hasCallerData()

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 getCallerData().

Returns:boolean

whether this event has caller data

prepareForDeferredProcessingback to summary
public void prepareForDeferredProcessing()

Redeclares ch.qos.logback.core.spi.DeferredProcessingAware.prepareForDeferredProcessing.