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 LevelPtr & | getLevel () 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 | |
static int64_t | getStartTime () |
Public Attributes | |
String | fqnOfCategoryClass |
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.
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.
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. |
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 |
const String& getMessage | ( | ) | const [inline] |
Return the message for this logging event.
const String & getNDC | ( | ) | const |
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.
const String& getRenderedMessage | ( | ) | const [inline] |
Return the message for this logging event.
static 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.
String fqnOfCategoryClass |
Fully qualified name of the calling category class.