public class LoggingEvent extends Object implements ch.qos.logback.classic.spi.ILoggingEvent
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.
| Constructor and Description |
|---|
LoggingEvent() |
LoggingEvent(String fqcn,
ch.qos.logback.classic.Logger logger,
ch.qos.logback.classic.Level level,
String message,
Throwable throwable,
Object[] argArray) |
| Modifier and Type | Method and Description |
|---|---|
Object[] |
getArgumentArray() |
StackTraceElement[] |
getCallerData()
Get the caller information for this logging event.
|
long |
getContextBirthTime() |
String |
getFormattedMessage() |
ch.qos.logback.classic.Level |
getLevel() |
ch.qos.logback.classic.spi.LoggerContextVO |
getLoggerContextVO() |
String |
getLoggerName() |
org.slf4j.Marker |
getMarker() |
Map<String,String> |
getMdc()
Deprecated.
Replaced by [@link #getMDCPropertyMap}
|
Map<String,String> |
getMDCPropertyMap() |
String |
getMessage() |
String |
getThreadName() |
ch.qos.logback.classic.spi.IThrowableProxy |
getThrowableProxy()
Returns the throwable information contained within this event.
|
long |
getTimeStamp() |
boolean |
hasCallerData() |
void |
prepareForDeferredProcessing()
This method should be called prior to serializing an event.
|
void |
setArgumentArray(Object[] argArray) |
void |
setCallerData(StackTraceElement[] callerDataArray) |
void |
setLevel(ch.qos.logback.classic.Level level) |
void |
setLoggerContextRemoteView(ch.qos.logback.classic.spi.LoggerContextVO loggerContextVO) |
void |
setLoggerName(String loggerName) |
void |
setMarker(org.slf4j.Marker marker) |
void |
setMDCPropertyMap(Map<String,String> map)
Set the MDC map for this event.
|
void |
setMessage(String message) |
void |
setThreadName(String threadName) |
void |
setThrowableProxy(ch.qos.logback.classic.spi.ThrowableProxy tp)
Set this event's throwable information.
|
void |
setTimeStamp(long timeStamp) |
String |
toString() |
public void setArgumentArray(Object[] argArray)
public Object[] getArgumentArray()
getArgumentArray in interface ch.qos.logback.classic.spi.ILoggingEventpublic ch.qos.logback.classic.Level getLevel()
getLevel in interface ch.qos.logback.classic.spi.ILoggingEventpublic String getLoggerName()
getLoggerName in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setLoggerName(String loggerName)
public String getThreadName()
getThreadName in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setThreadName(String threadName) throws IllegalStateException
threadName - The threadName to set.IllegalStateException - If threadName has been already set.public ch.qos.logback.classic.spi.IThrowableProxy getThrowableProxy()
null if there is no such information.getThrowableProxy in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setThrowableProxy(ch.qos.logback.classic.spi.ThrowableProxy tp)
public void prepareForDeferredProcessing()
prepareForDeferredProcessing in interface ch.qos.logback.classic.spi.ILoggingEventprepareForDeferredProcessing in interface ch.qos.logback.core.spi.DeferredProcessingAwarepublic ch.qos.logback.classic.spi.LoggerContextVO getLoggerContextVO()
getLoggerContextVO in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setLoggerContextRemoteView(ch.qos.logback.classic.spi.LoggerContextVO loggerContextVO)
public String getMessage()
getMessage in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setMessage(String message)
public long getTimeStamp()
getTimeStamp in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setTimeStamp(long timeStamp)
public void setLevel(ch.qos.logback.classic.Level level)
public StackTraceElement[] getCallerData()
Note that after serialization it is impossible to correctly extract caller information.
getCallerData in interface ch.qos.logback.classic.spi.ILoggingEventpublic boolean hasCallerData()
hasCallerData in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setCallerData(StackTraceElement[] callerDataArray)
public org.slf4j.Marker getMarker()
getMarker in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setMarker(org.slf4j.Marker marker)
public long getContextBirthTime()
public String getFormattedMessage()
getFormattedMessage in interface ch.qos.logback.classic.spi.ILoggingEventpublic Map<String,String> getMDCPropertyMap()
getMDCPropertyMap in interface ch.qos.logback.classic.spi.ILoggingEventpublic void setMDCPropertyMap(Map<String,String> map)
map - public Map<String,String> getMdc()
getMdc in interface ch.qos.logback.classic.spi.ILoggingEventCopyright © 2019 SPF4J. All rights reserved.