Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members | Related Pages

LoggingEvent Class Reference

Inheritance diagram for LoggingEvent:

ObjectImpl Object List of all members.

Public Member Functions

 LoggingEvent ()
 LoggingEvent (const String &fqnOfLoggerClass, const LoggerPtr &logger, const LevelPtr &level, const String &message, const char *file=0, int line=-1)
const LevelPtrgetLevel () const
const String & getLoggerName () const
const String & getMessage () const
const String & getRenderedMessage () const
unsigned long getThreadId () const
int64_t getTimeStamp () const
const String & getNDC () const
void write (helpers::SocketOutputStreamPtr &os) const
void read (const helpers::SocketInputStreamPtr &is)
String getMDC (const String &key) const
std::set< String > getMDCKeySet () const
void getMDCCopy () const
String getProperty (const String &key) const
std::set< String > getPropertyKeySet () const
void setProperty (const String &key, const String &value)

Static Public Member Functions

int64_t getStartTime ()

Public Attributes

String fqnOfCategoryClass

Detailed Description

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 log4cxx components.

This class is of concern to those wishing to extend log4cxx.


Constructor & Destructor Documentation

LoggingEvent  ) 
 

For serialization only

LoggingEvent const String &  fqnOfLoggerClass,
const LoggerPtr logger,
const LevelPtr level,
const String &  message,
const char *  file = 0,
int  line = -1
 

Instantiate a LoggingEvent from the supplied parameters.

Except #timeStamp all the other fields of LoggingEvent are filled when actually needed.

Parameters:
fqnOfLoggerClass The fully qualified name of the calling logger class.
logger The logger of this event.
level The level of this event.
message The message of this event.
file The file where this log statement was written.
line The line where this log statement was written.


Member Function Documentation

const LevelPtr& getLevel  )  const [inline]
 

Return the #level of this event.

const String & getLoggerName  )  const
 

Return the name of the #logger.

String getMDC const String &  key  )  const
 

Returns the the context corresponding to the key parameter. If there is a local MDC copy, possibly because we are in a logging server or running inside AsyncAppender, then we search for the key in MDC copy, if a value is found it is returned. Otherwise, if the search in MDC copy returns an empty result, then the current thread's MDC is used.

Note that both the local MDC copy and the current thread's MDC are searched.

void getMDCCopy  )  const
 

Obtain a copy of this thread's MDC prior to serialization or asynchronous logging.

std::set< String > getMDCKeySet  )  const
 

Returns the set of of the key values in the MDC for the event. The returned set is unmodifiable by the caller.

Returns:
Set an unmodifiable set of the MDC keys.
Since:
1.3

const String& getMessage  )  const [inline]
 

Return the #message for this logging event.

const String & getNDC  )  const
 

This method returns the NDC for this event. It will return the correct content even if the event was generated in a different thread or even on a different machine. The NDC::get method should never be called directly.

String getProperty const String &  key  )  const
 

Return a previously set property. The return value can be null.

std::set< String > getPropertyKeySet  )  const
 

Returns the set of of the key values in the properties for the event. The returned set is unmodifiable by the caller.

Returns:
Set an unmodifiable set of the property keys.

const String& getRenderedMessage  )  const [inline]
 

Return the #message for this logging event.

int64_t getStartTime  )  [inline, static]
 

Returns the time when the application started, in seconds elapsed since 01.01.1970.

unsigned long getThreadId  )  const [inline]
 

Return the #threadId of this event.

int64_t getTimeStamp  )  const [inline]
 

Return the #timeStamp of this event.

void read const helpers::SocketInputStreamPtr is  ) 
 

Read this event from a helpers::SocketOutputStream.

void setProperty const String &  key,
const String &  value
 

Set a string property using a key and a string value. since 1.3

void write helpers::SocketOutputStreamPtr os  )  const
 

Write this event to a helpers::SocketOutputStream.


Member Data Documentation

String fqnOfCategoryClass
 

Fully qualified name of the calling category class.


The documentation for this class was generated from the following files:
Generated on Tue Jul 24 17:50:57 2007 for log4cxx by  doxygen 1.3.9.1