- 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 InstantReturn theInstantthe event was created.List<org.slf4j.event.KeyValuePair> A list ofKeyValuePairobjects.getLevel()default org.slf4j.MarkerDeprecated.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.intReturn the number of elapsed nanoseconds found ingetInstant()May return -1 if data unavailable.longThe sequence number associated with this event.longReturn the number of elapsed milliseconds since epoch.booleanIf 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 theInstantthe event was created. Default implementation returns the instant corresponding to the value returned by @linkgetTimeStamp().- Returns:
- the
Instantthe 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 ofKeyValuePairobjects. The returned list may be null.- Returns:
- may be null
- Since:
- 1.3.0
-
prepareForDeferredProcessing
void prepareForDeferredProcessing()- Specified by:
prepareForDeferredProcessingin interfaceDeferredProcessingAware
-
getMarkerList()