public class LoggingEvent extends java.lang.Object implements 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(java.lang.String fqcn,
Logger logger,
Level level,
java.lang.String message,
java.lang.Throwable throwable,
java.lang.Object[] argArray) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getArgumentArray() |
java.lang.StackTraceElement[] |
getCallerData()
Get the caller information for this logging event.
|
long |
getContextBirthTime() |
java.lang.String |
getFormattedMessage() |
Level |
getLevel() |
LoggerContextVO |
getLoggerContextVO() |
java.lang.String |
getLoggerName() |
Marker |
getMarker() |
java.util.Map<java.lang.String,java.lang.String> |
getMdc()
Deprecated.
Replaced by [@link #getMDCPropertyMap}
|
java.util.Map<java.lang.String,java.lang.String> |
getMDCPropertyMap()
Returns the MDC map.
|
java.lang.String |
getMessage() |
java.lang.String |
getThreadName() |
IThrowableProxy |
getThrowableProxy()
Returns the throwable information contained within this event.
|
long |
getTimeStamp() |
boolean |
hasCallerData()
If this event has caller data, then true is returned.
|
void |
prepareForDeferredProcessing()
This method should be called prior to serializing an event.
|
void |
setArgumentArray(java.lang.Object[] argArray) |
void |
setCallerData(java.lang.StackTraceElement[] callerDataArray) |
void |
setLevel(Level level) |
void |
setLoggerContextRemoteView(LoggerContextVO loggerContextVO) |
void |
setLoggerName(java.lang.String loggerName) |
void |
setMarker(Marker marker) |
void |
setMDCPropertyMap(java.util.Map<java.lang.String,java.lang.String> map)
Set the MDC map for this event.
|
void |
setMessage(java.lang.String message) |
void |
setThreadName(java.lang.String threadName) |
void |
setThrowableProxy(ThrowableProxy tp)
Set this event's throwable information.
|
void |
setTimeStamp(long timeStamp) |
java.lang.String |
toString() |
public void setArgumentArray(java.lang.Object[] argArray)
public java.lang.Object[] getArgumentArray()
getArgumentArray
in interface ILoggingEvent
public Level getLevel()
getLevel
in interface ILoggingEvent
public java.lang.String getLoggerName()
getLoggerName
in interface ILoggingEvent
public void setLoggerName(java.lang.String loggerName)
public java.lang.String getThreadName()
getThreadName
in interface ILoggingEvent
public void setThreadName(java.lang.String threadName) throws java.lang.IllegalStateException
threadName
- The threadName to set.java.lang.IllegalStateException
- If threadName has been already set.public IThrowableProxy getThrowableProxy()
null
if there is no such information.getThrowableProxy
in interface ILoggingEvent
public void setThrowableProxy(ThrowableProxy tp)
public void prepareForDeferredProcessing()
prepareForDeferredProcessing
in interface ILoggingEvent
prepareForDeferredProcessing
in interface DeferredProcessingAware
public LoggerContextVO getLoggerContextVO()
getLoggerContextVO
in interface ILoggingEvent
public void setLoggerContextRemoteView(LoggerContextVO loggerContextVO)
public java.lang.String getMessage()
getMessage
in interface ILoggingEvent
public void setMessage(java.lang.String message)
public long getTimeStamp()
getTimeStamp
in interface ILoggingEvent
public void setTimeStamp(long timeStamp)
public void setLevel(Level level)
public java.lang.StackTraceElement[] getCallerData()
Note that after serialization it is impossible to correctly extract caller information.
getCallerData
in interface ILoggingEvent
ILoggingEvent.hasCallerData()
public boolean hasCallerData()
ILoggingEvent
Logback components wishing to use caller data if available without
causing it to be computed can invoke this method before invoking
ILoggingEvent.getCallerData()
.
hasCallerData
in interface ILoggingEvent
public void setCallerData(java.lang.StackTraceElement[] callerDataArray)
public Marker getMarker()
getMarker
in interface ILoggingEvent
public void setMarker(Marker marker)
public long getContextBirthTime()
public java.lang.String getFormattedMessage()
getFormattedMessage
in interface ILoggingEvent
public java.util.Map<java.lang.String,java.lang.String> getMDCPropertyMap()
ILoggingEvent
getMDCPropertyMap
in interface ILoggingEvent
public void setMDCPropertyMap(java.util.Map<java.lang.String,java.lang.String> map)
map
- public java.util.Map<java.lang.String,java.lang.String> getMdc()
getMdc
in interface ILoggingEvent
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved