org.apache.log
Class LogEvent
- Serializable
public final class LogEvent
extends java.lang.Object
implements Serializable
This class encapsulates each individual log event.
LogEvents usually originate at a Logger and are routed
to LogTargets.
START_TIME
private static final long START_TIME
m_category
private String m_category
m_message
private String m_message
m_throwable
private Throwable m_throwable
m_time
private long m_time
getCategory
public final String getCategory()
Get the category that LogEvent relates to.
getContextMap
public final ContextMap getContextMap()
Get ContextMap associated with LogEvent
getMessage
public final String getMessage()
Get the message associated with event.
getPriority
public final Priority getPriority()
Get Priority for LogEvent.
getRelativeTime
public final long getRelativeTime()
Get the time of the log event relative to start of application.
getThrowable
public final Throwable getThrowable()
Get throwabe instance associated with event.
getTime
public final long getTime()
Get the absolute time of the log event.
readResolve
private Object readResolve()
throws ObjectStreamException
Helper method that replaces deserialized priority with correct singleton.
- the singleton version of object
setCategory
public final void setCategory(String category)
Set the LogEvent category.
setContextMap
public final void setContextMap(ContextMap contextMap)
Set the ContextMap for this LogEvent.
contextMap
- the context map
setMessage
public final void setMessage(String message)
Set the message for LogEvent.
setPriority
public final void setPriority(Priority priority)
Set the priority of LogEvent.
priority
- the new LogEvent priority
setThrowable
public final void setThrowable(Throwable throwable)
Set the throwable for LogEvent.
throwable
- the instance of Throwable
setTime
public final void setTime(long time)
Set the absolute time of LogEvent.