org.apache.log

Class LogEvent

public final class LogEvent extends Object implements Serializable

This class encapsulates each individual log event. LogEvents usually originate at a Logger and are routed to LogTargets.

Author: Avalon Development Team Peter Donald

Field Summary
Stringm_category
ContextMapm_contextMap
Stringm_message
Prioritym_priority
Throwablem_throwable
longm_time
static longSTART_TIME
Method Summary
StringgetCategory()
Get the category that LogEvent relates to.
ContextMapgetContextMap()
Get ContextMap associated with LogEvent
StringgetMessage()
Get the message associated with event.
PrioritygetPriority()
Get Priority for LogEvent.
longgetRelativeTime()
Get the time of the log event relative to start of application.
ThrowablegetThrowable()
Get throwabe instance associated with event.
longgetTime()
Get the absolute time of the log event.
ObjectreadResolve()
Helper method that replaces deserialized priority with correct singleton.
voidsetCategory(String category)
Set the LogEvent category.
voidsetContextMap(ContextMap contextMap)
Set the ContextMap for this LogEvent.
voidsetMessage(String message)
Set the message for LogEvent.
voidsetPriority(Priority priority)
Set the priority of LogEvent.
voidsetThrowable(Throwable throwable)
Set the throwable for LogEvent.
voidsetTime(long time)
Set the absolute time of LogEvent.

Field Detail

m_category

private String m_category

m_contextMap

private ContextMap m_contextMap

m_message

private String m_message

m_priority

private Priority m_priority

m_throwable

private Throwable m_throwable

m_time

private long m_time

START_TIME

private static final long START_TIME

Method Detail

getCategory

public final String getCategory()
Get the category that LogEvent relates to.

Returns: the name of category

getContextMap

public final ContextMap getContextMap()
Get ContextMap associated with LogEvent

Returns: the ContextMap

getMessage

public final String getMessage()
Get the message associated with event.

Returns: the message

getPriority

public final Priority getPriority()
Get Priority for LogEvent.

Returns: the LogEvent Priority

getRelativeTime

public final long getRelativeTime()
Get the time of the log event relative to start of application.

Returns: the time

getThrowable

public final Throwable getThrowable()
Get throwabe instance associated with event.

Returns: the Throwable

getTime

public final long getTime()
Get the absolute time of the log event.

Returns: the absolute time

readResolve

private Object readResolve()
Helper method that replaces deserialized priority with correct singleton.

Returns: the singleton version of object

Throws: ObjectStreamException if an error occurs

setCategory

public final void setCategory(String category)
Set the LogEvent category.

Parameters: category the category

setContextMap

public final void setContextMap(ContextMap contextMap)
Set the ContextMap for this LogEvent.

Parameters: contextMap the context map

setMessage

public final void setMessage(String message)
Set the message for LogEvent.

Parameters: message the message

setPriority

public final void setPriority(Priority priority)
Set the priority of LogEvent.

Parameters: priority the new LogEvent priority

setThrowable

public final void setThrowable(Throwable throwable)
Set the throwable for LogEvent.

Parameters: throwable the instance of Throwable

setTime

public final void setTime(long time)
Set the absolute time of LogEvent.

Parameters: time the time