ch.qos.logback.classic.spi
Class LoggingEventExt

java.lang.Object
  extended by ch.qos.logback.classic.spi.LoggingEventExt
All Implemented Interfaces:
Externalizable, Serializable

public class LoggingEventExt
extends Object
implements Externalizable

The internal representation of logging events. When an affirmative decision is made to log then a LoggingEvent instance is created. This instance is passed around to the different Logback components.

Writers of Logback components such as appenders should be aware of that some of the LoggingEvent fields are initialized lazily. Therefore, an appender wishing to output data to be later correctly read by a receiver, must initialize "lazy" fields prior to writing them out. See the prepareForDeferredProcessing() method for the exact list.

Author:
Ceki Gülcü, Sébastien Pennec
See Also:
Serialized Form

Constructor Summary
LoggingEventExt()
           
LoggingEventExt(String fqcn, org.slf4j.Logger logger, Level level, String message, Throwable throwable, Object[] argArray)
           
 
Method Summary
 Object[] getArgumentArray()
           
 CallerData[] getCallerData()
          Get the caller information for this logging event.
 String getFormattedMessage()
           
 Level getLevel()
           
 org.slf4j.Logger getLogger()
           
 org.slf4j.Marker getMarker()
           
 String getMessage()
           
static long getStartTime()
          The time at which this class was loaded into memory, expressed in millisecond elapsed since the epoch (1.1.1970).
 String getThreadName()
           
 ThrowableProxy getThrowableInformation()
          Returns the throwable information contained within this event.
 long getTimeStamp()
           
 void prepareForDeferredProcessing()
          This method should be called prior to serializing an event.
 void readExternal(ObjectInput in)
           
 void setCallerInformation(CallerData[] callerDataArray)
           
 void setLevel(Level level)
           
 void setLogger(org.slf4j.Logger logger)
           
 void setMarker(org.slf4j.Marker marker)
           
 void setMessage(String message)
           
 void setThreadName(String threadName)
           
 void setThrowableInformation(ThrowableProxy ti)
          Set this event's throwable information.
 void setTimeStamp(long timeStamp)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingEventExt

public LoggingEventExt()

LoggingEventExt

public LoggingEventExt(String fqcn,
                       org.slf4j.Logger logger,
                       Level level,
                       String message,
                       Throwable throwable,
                       Object[] argArray)
Method Detail

getArgumentArray

public Object[] getArgumentArray()

getLevel

public Level getLevel()

getThreadName

public String getThreadName()

setThreadName

public void setThreadName(String threadName)
                   throws IllegalStateException
Parameters:
threadName - The threadName to set.
Throws:
IllegalStateException - If threadName has been already set.

getThrowableInformation

public ThrowableProxy getThrowableInformation()
Returns the throwable information contained within this event. May be null if there is no such information.


setThrowableInformation

public void setThrowableInformation(ThrowableProxy ti)
Set this event's throwable information.


prepareForDeferredProcessing

public void prepareForDeferredProcessing()
This method should be called prior to serializing an event. It should also be called when using asynchronous logging.


getLogger

public org.slf4j.Logger getLogger()

setLogger

public void setLogger(org.slf4j.Logger logger)

getMessage

public String getMessage()

setMessage

public void setMessage(String message)

getTimeStamp

public long getTimeStamp()

setTimeStamp

public void setTimeStamp(long timeStamp)

setLevel

public void setLevel(Level level)

getStartTime

public static final long getStartTime()
The time at which this class was loaded into memory, expressed in millisecond elapsed since the epoch (1.1.1970).

Returns:
The time as measured when this class was loaded into memory.

getCallerData

public CallerData[] getCallerData()
Get the caller information for this logging event. If caller information is null at the time of its invocation, this method extracts location information. The collected information is cached for future use.

Note that after serialization it is impossible to correctly extract caller information.


setCallerInformation

public void setCallerInformation(CallerData[] callerDataArray)

getMarker

public org.slf4j.Marker getMarker()

setMarker

public void setMarker(org.slf4j.Marker marker)

getFormattedMessage

public String getFormattedMessage()

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


Copyright © 2005-2009 QOS.ch. All Rights Reserved.