- All Superinterfaces:
DeferredProcessingAware
- All Known Implementing Classes:
LoggingEvent
,LoggingEventVO
The central interface in logback-classic. In a nutshell, logback-classic is
nothing more than a processing chain built around this interface.
- Since:
- 0.9.16
- Author:
- Ceki Gülcü
-
Method Summary
Modifier and TypeMethodDescriptionObject[]
Return caller data associated with this event.default Instant
Return theInstant
the event was created.List
<org.slf4j.event.KeyValuePair> A list ofKeyValuePair
objects.getLevel()
default org.slf4j.Marker
Deprecated.List
<org.slf4j.Marker> Since SLF4J 2.0.0, the slf4j logging API assumes the possibility of multiple Marker instances in a logging event.getMdc()
Deprecated.Replaced by [@link #getMDCPropertyMap}Returns the MDC map.int
Return the number of elapsed nanoseconds found ingetInstant()
May return -1 if data unavailable.long
The sequence number associated with this event.long
Return the number of elapsed milliseconds since epoch.boolean
If this event has caller data, then true is returned.void
-
Method Details
-
getThreadName
-
getLevel
-
getMessage
-
getArgumentArray
-
getFormattedMessage
-
getLoggerName
-
getLoggerContextVO
-
getThrowableProxy
-
getCallerData
Return caller data associated with this event. Note that calling this event may trigger the computation of caller data.- Returns:
- the caller data associated with this event.
- See Also:
-
hasCallerData
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:
- whether this event has caller data
-
getMarker
Deprecated.Replaced bygetMarkerList()
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 usegetMarkerList()
and cater for all available markers and not only the first one.- Returns:
- the first marker in the marker list or null if no markers are available
-
getMarkerList
List<org.slf4j.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:
- the marker list, may be null
- Since:
- 1.3.0
-
getMDCPropertyMap
Returns the MDC map. The returned value can be an empty map but not null. -
getMdc
-
getTimeStamp
long getTimeStamp()Return the number of elapsed milliseconds since epoch.- Returns:
- the number of elapsed milliseconds since epoch
- Since:
- 1.3
-
getNanoseconds
int getNanoseconds()Return the number of elapsed nanoseconds found ingetInstant()
May return -1 if data unavailable.- Returns:
- the number of elapsed nanoseconds as found in
getInstant()
- Since:
- 1.3
-
getInstant
Return theInstant
the event was created. Default implementation returns the instant corresponding to the value returned by @linkgetTimeStamp()
.- Returns:
- the
Instant
the event was created. - Since:
- 1.3
-
getSequenceNumber
long getSequenceNumber()The sequence number associated with this event.Sequence numbers, if present, should be increasing monotonically.
- Since:
- 1.3.0
-
getKeyValuePairs
List<org.slf4j.event.KeyValuePair> getKeyValuePairs()A list ofKeyValuePair
objects. The returned list may be null.- Returns:
- may be null
- Since:
- 1.3.0
-
prepareForDeferredProcessing
void prepareForDeferredProcessing()- Specified by:
prepareForDeferredProcessing
in interfaceDeferredProcessingAware
-
getMarkerList()