org.apache.log

Class LogEvent

Implemented Interfaces:
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.

Authors:
Avalon Development Team
Peter Donald

Method Summary

String
getCategory()
Get the category that LogEvent relates to.
ContextMap
getContextMap()
Get ContextMap associated with LogEvent
ContextStack
getContextStack()
Deprecated. ContextStack has been deprecated and thus so has this method
String
getMessage()
Get the message associated with event.
Priority
getPriority()
Get Priority for LogEvent.
long
getRelativeTime()
Get the time of the log event relative to start of application.
Throwable
getThrowable()
Get throwabe instance associated with event.
long
getTime()
Get the absolute time of the log event.
void
setCategory(String category)
Set the LogEvent category.
void
setContextMap(ContextMap contextMap)
Set the ContextMap for this LogEvent.
void
setContextStack(ContextStack contextStack)
Deprecated. ContextStack has been deprecated and thus so has this method
void
setMessage(String message)
Set the message for LogEvent.
void
setPriority(Priority priority)
Set the priority of LogEvent.
void
setThrowable(Throwable throwable)
Set the throwable for LogEvent.
void
setTime(long time)
Set the absolute time of LogEvent.

Method Details

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


getContextStack

public final ContextStack getContextStack()

Deprecated. ContextStack has been deprecated and thus so has this method

Get ContextStack associated with LogEvent

Returns:
the ContextStack


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


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


setContextStack

public final void setContextStack(ContextStack contextStack)

Deprecated. ContextStack has been deprecated and thus so has this method

Set the ContextStack for this LogEvent. Note that if this LogEvent ever changes threads, the ContextStack must be cloned.

Parameters:
contextStack - the context stack


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


"Copyright B) 2001 Apache Jakarta Project. All Rights Reserved."