Top Description Fields Constructors Methods
org.apache.log

public final Class LogEvent

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.ObjectStreamException, .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

Field Summary

Modifier and TypeField and Description
private String
private ContextMap
private String
private Priority
private Throwable
private long
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the name of category
getCategory
()

Get the category that LogEvent relates to.

public final ContextMap

Returns:

the ContextMap
getContextMap
()

Get ContextMap associated with LogEvent

public final String

Returns:

the message
getMessage
()

Get the message associated with event.

public final Priority

Returns:

the LogEvent Priority
getPriority
()

Get Priority for LogEvent.

public final long

Returns:

the time
getRelativeTime
()

Get the time of the log event relative to start of application.

public final Throwable

Returns:

the Throwable
getThrowable
()

Get throwabe instance associated with event.

public final long

Returns:

the absolute time
getTime
()

Get the absolute time of the log event.

private Object

Returns:

the singleton version of object
readResolve
()

Helper method that replaces deserialized priority with correct singleton.

public final void
setCategory(final String
the category
category
)

Set the LogEvent category.

public final void
setContextMap(final ContextMap
the context map
contextMap
)

Set the ContextMap for this LogEvent.

public final void
setMessage(final String
the message
message
)

Set the message for LogEvent.

public final void
setPriority(final Priority
the new LogEvent priority
priority
)

Set the priority of LogEvent.

public final void
setThrowable(final Throwable
the instance of Throwable
throwable
)

Set the throwable for LogEvent.

public final void
setTime(final long
the time
time
)

Set the absolute time of LogEvent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_categoryback to summary
private String m_category
m_contextMapback to summary
private ContextMap m_contextMap
m_messageback to summary
private String m_message
m_priorityback to summary
private Priority m_priority
m_throwableback to summary
private Throwable m_throwable
m_timeback to summary
private long m_time
START_TIMEback to summary
private static final long START_TIME

Constructor Detail

LogEventback to summary
public LogEvent()

Method Detail

getCategoryback to summary
public final String getCategory()

Get the category that LogEvent relates to.

Returns:String

the name of category

getContextMapback to summary
public final ContextMap getContextMap()

Get ContextMap associated with LogEvent

Returns:ContextMap

the ContextMap

getMessageback to summary
public final String getMessage()

Get the message associated with event.

Returns:String

the message

getPriorityback to summary
public final Priority getPriority()

Get Priority for LogEvent.

Returns:Priority

the LogEvent Priority

getRelativeTimeback to summary
public final long getRelativeTime()

Get the time of the log event relative to start of application.

Returns:long

the time

getThrowableback to summary
public final Throwable getThrowable()

Get throwabe instance associated with event.

Returns:Throwable

the Throwable

getTimeback to summary
public final long getTime()

Get the absolute time of the log event.

Returns:long

the absolute time

readResolveback to summary
private Object readResolve() throws ObjectStreamException

Helper method that replaces deserialized priority with correct singleton.

Returns:Object

the singleton version of object

Exceptions
ObjectStreamException:
if an error occurs
setCategoryback to summary
public final void setCategory(final String category)

Set the LogEvent category.

Parameters
category:String

the category

setContextMapback to summary
public final void setContextMap(final ContextMap contextMap)

Set the ContextMap for this LogEvent.

Parameters
contextMap:ContextMap

the context map

setMessageback to summary
public final void setMessage(final String message)

Set the message for LogEvent.

Parameters
message:String

the message

setPriorityback to summary
public final void setPriority(final Priority priority)

Set the priority of LogEvent.

Parameters
priority:Priority

the new LogEvent priority

setThrowableback to summary
public final void setThrowable(final Throwable throwable)

Set the throwable for LogEvent.

Parameters
throwable:Throwable

the instance of Throwable

setTimeback to summary
public final void setTime(final long time)

Set the absolute time of LogEvent.

Parameters
time:long

the time