public class LoggingEvent extends Object
Modifier and Type | Field and Description |
---|---|
long |
timeStamp
The number of milliseconds elapsed from 1/1/1970 until logging event was created.
|
Constructor and Description |
---|
LoggingEvent()
Constructs a new instance.
|
LoggingEvent(String fqnOfCategoryClass,
Category logger,
long timeStamp,
Level level,
Object message,
String threadName,
ThrowableInformation throwable,
String ndc,
LocationInfo info,
Map properties)
Create new instance.
|
LoggingEvent(String fqnOfCategoryClass,
Category logger,
long timeStamp,
Priority level,
Object message,
Throwable throwable)
Instantiate a LoggingEvent from the supplied parameters.
|
LoggingEvent(String fqnOfCategoryClass,
Category logger,
Priority level,
Object message,
Throwable throwable)
Instantiate a LoggingEvent from the supplied parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
getFQNOfLoggerClass() |
Level |
getLevel()
Return the level of this event.
|
LocationInfo |
getLocationInformation()
Set the location information for this logging event.
|
Category |
getLogger()
Gets the logger of the event.
|
String |
getLoggerName()
Return the name of the logger.
|
Object |
getMDC(String key) |
void |
getMDCCopy()
Obtain a copy of this thread's MDC prior to serialization or
asynchronous logging.
|
Object |
getMessage()
Return the message for this logging event.
|
String |
getNDC() |
Map |
getProperties() |
String |
getProperty(String key) |
Set |
getPropertyKeySet() |
String |
getRenderedMessage() |
static long |
getStartTime()
Returns the time when the application started, in milliseconds
elapsed since 01.01.1970.
|
String |
getThreadName() |
ThrowableInformation |
getThrowableInformation()
Returns the throwable information contained within this
event.
|
String[] |
getThrowableStrRep()
Return this event's throwable's string[] representaion.
|
long |
getTimeStamp() |
Object |
removeProperty(String propName) |
void |
setProperty(String propName,
String propValue) |
public final long timeStamp
public LoggingEvent()
public LoggingEvent(String fqnOfCategoryClass, Category logger, long timeStamp, Level level, Object message, String threadName, ThrowableInformation throwable, String ndc, LocationInfo info, Map properties)
fqnOfCategoryClass
- Fully qualified class name of Logger implementation.logger
- The logger generating this event.timeStamp
- the timestamp of this logging eventlevel
- The level of this event.message
- The message of this event.threadName
- thread namethrowable
- The throwable of this event.ndc
- Nested diagnostic contextinfo
- Location infoproperties
- MDC propertiespublic LoggingEvent(String fqnOfCategoryClass, Category logger, long timeStamp, Priority level, Object message, Throwable throwable)
Except timeStamp
all the other fields of LoggingEvent
are filled when actually needed.
logger
- The logger generating this event.timeStamp
- the timestamp of this logging eventlevel
- The level of this event.message
- The message of this event.throwable
- The throwable of this event.public LoggingEvent(String fqnOfCategoryClass, Category logger, Priority level, Object message, Throwable throwable)
Except timeStamp
all the other fields of LoggingEvent
are filled when actually needed.
logger
- The logger generating this event.level
- The level of this event.message
- The message of this event.throwable
- The throwable of this event.public static long getStartTime()
public String getFQNOfLoggerClass()
public Level getLevel()
level
field.public LocationInfo getLocationInformation()
public Category getLogger()
public String getLoggerName()
categoryName
field.public void getMDCCopy()
public Object getMessage()
Before serialization, the returned object is the message passed by the user to generate the logging event. After serialization, the returned value equals the String form of the message possibly after object rendering.
public String getNDC()
public Map getProperties()
public Set getPropertyKeySet()
public String getRenderedMessage()
public String getThreadName()
public ThrowableInformation getThrowableInformation()
null
if there is no such information.
Note that the Throwable
object contained within a
ThrowableInformation
does not survive serialization.
public String[] getThrowableStrRep()
public long getTimeStamp()
Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.