|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.pattern.LogEvent
public class LogEvent
This class is a copy of o.a.l.spi.LoggingEvent from log4j 1.2.15 which has been renamed to keep the same overall class name length to allow a serialization written with a prior instance of o.a.l.spi.LoggingEvent to be deserialized with this class just by mangling the class name in the byte stream.
Field Summary | |
---|---|
java.lang.String |
categoryName
Deprecated. This field will be marked as private in future releases. Please do not access it directly. Use the getLoggerName() method instead. |
java.lang.String |
fqnOfCategoryClass
Fully qualified name of the calling category class. |
org.apache.log4j.Priority |
level
Deprecated. This field will be marked as private in future releases. Please do not access it directly. Use the getLevel() method instead. |
long |
timeStamp
The number of milliseconds elapsed from 1/1/1970 until logging event was created. |
Constructor Summary | |
---|---|
LogEvent(java.lang.String fqnOfCategoryClass,
org.apache.log4j.Category logger,
long timeStamp,
org.apache.log4j.Priority level,
java.lang.Object message,
java.lang.Throwable throwable)
Instantiate a LoggingEvent from the supplied parameters. |
|
LogEvent(java.lang.String fqnOfCategoryClass,
org.apache.log4j.Category logger,
org.apache.log4j.Priority level,
java.lang.Object message,
java.lang.Throwable throwable)
Instantiate a LoggingEvent from the supplied parameters. |
|
LogEvent(java.lang.String fqnOfCategoryClass,
org.apache.log4j.Logger logger,
long timeStamp,
org.apache.log4j.Level level,
java.lang.Object message,
java.lang.String threadName,
org.apache.log4j.spi.ThrowableInformation throwable,
java.lang.String ndc,
org.apache.log4j.spi.LocationInfo info,
java.util.Map properties)
Create new instance. |
Method Summary | |
---|---|
java.lang.String |
getFQNOfLoggerClass()
Get the fully qualified name of the calling logger sub-class/wrapper. |
org.apache.log4j.Level |
getLevel()
Return the level of this event. |
org.apache.log4j.spi.LocationInfo |
getLocationInformation()
Set the location information for this logging event. |
java.lang.String |
getLoggerName()
Return the name of the logger. |
java.lang.Object |
getMDC(java.lang.String key)
Returns the the context corresponding to the key
parameter. |
void |
getMDCCopy()
Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. |
java.lang.Object |
getMessage()
Return the message for this logging event. |
java.lang.String |
getNDC()
This method returns the NDC for this event. |
java.util.Map |
getProperties()
Returns the set of properties for the event. |
java.lang.String |
getProperty(java.lang.String key)
Return a property for this event. |
java.util.Set |
getPropertyKeySet()
Returns the set of the key values in the properties for the event. |
java.lang.String |
getRenderedMessage()
|
static long |
getStartTime()
Returns the time when the application started, in milliseconds elapsed since 01.01.1970. |
java.lang.String |
getThreadName()
|
org.apache.log4j.spi.ThrowableInformation |
getThrowableInformation()
Returns the throwable information contained within this event. |
java.lang.String[] |
getThrowableStrRep()
Return this event's throwable's string[] representaion. |
long |
getTimeStamp()
Getter for the event's time stamp. |
boolean |
locationInformationExists()
Check for the existence of location information without creating it (a byproduct of calling getLocationInformation). |
void |
setProperty(java.lang.String propName,
java.lang.String propValue)
Set value for MDC property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final transient java.lang.String fqnOfCategoryClass
public final java.lang.String categoryName
getLoggerName()
method instead.The category (logger) name.
public transient org.apache.log4j.Priority level
getLevel()
method instead. This field should not be accessed directly. You shoud use the
getLevel()
method instead.
public final long timeStamp
Constructor Detail |
---|
public LogEvent(java.lang.String fqnOfCategoryClass, org.apache.log4j.Category logger, org.apache.log4j.Priority level, java.lang.Object message, java.lang.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 LogEvent(java.lang.String fqnOfCategoryClass, org.apache.log4j.Category logger, long timeStamp, org.apache.log4j.Priority level, java.lang.Object message, java.lang.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 LogEvent(java.lang.String fqnOfCategoryClass, org.apache.log4j.Logger logger, long timeStamp, org.apache.log4j.Level level, java.lang.Object message, java.lang.String threadName, org.apache.log4j.spi.ThrowableInformation throwable, java.lang.String ndc, org.apache.log4j.spi.LocationInfo info, java.util.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 propertiesMethod Detail |
---|
public org.apache.log4j.spi.LocationInfo getLocationInformation()
public org.apache.log4j.Level getLevel()
level
field.
public java.lang.String getLoggerName()
categoryName
field.
public java.lang.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 java.lang.String getNDC()
NDC.get()
method
should never be called directly.
public java.lang.Object getMDC(java.lang.String key)
key
parameter. If there is a local MDC copy, possibly because we are
in a logging server or running inside AsyncAppender, then we
search for the key in MDC copy, if a value is found it is
returned. Otherwise, if the search in MDC copy returns a null
result, then the current thread's MDC
is used.
Note that both the local MDC copy and the current thread's MDC are searched.
public void getMDCCopy()
public java.lang.String getRenderedMessage()
public static long getStartTime()
public java.lang.String getThreadName()
public org.apache.log4j.spi.ThrowableInformation getThrowableInformation()
null
if there is no such information.
Note that the Throwable
object contained within a
ThrowableInformation
does not survive serialization.
public java.lang.String[] getThrowableStrRep()
public final void setProperty(java.lang.String propName, java.lang.String propValue)
propName
- propValue
- public final java.lang.String getProperty(java.lang.String key)
key
- property name
public final boolean locationInformationExists()
public final long getTimeStamp()
public java.util.Set getPropertyKeySet()
public java.util.Map getProperties()
public java.lang.String getFQNOfLoggerClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010 The Apache Software Foundation. Licensed under the Apache License, Version 2.0
Apache Extras Companion for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.