Apache Log4cxx
Version 1.3.0
|
The data recorded for each logging request. More...
#include <loggingevent.h>
Public Types | |
typedef spi::KeySet | KeySet |
Public Member Functions | |
LoggingEvent () | |
An empty event. | |
LoggingEvent (const LogString &logger, const LevelPtr &level, const LocationInfo &location, LogString &&message) | |
An event composed using the supplied parameters. | |
LoggingEvent (const LogString &logger, const LevelPtr &level, const LogString &message, const LocationInfo &location) | |
An event composed using the supplied parameters. | |
~LoggingEvent () | |
const LevelPtr & | getLevel () const |
The severity level of the logging request that generated this event. | |
const LogString & | getLoggerName () const |
The name of the logger used to make the logging request. | |
const LogString & | getMessage () const |
The message provided in the logging request. | |
const LogString & | getRenderedMessage () const |
The message provided in the logging request. | |
const LogString & | getThreadName () const |
The identity of the thread in which this logging event was created. | |
const LogString & | getThreadUserName () const |
The name you gave to the thread in which this logging event was created. | |
log4cxx_time_t | getTimeStamp () const |
The number of microseconds elapsed since 1970-01-01 at the time this logging event was created. | |
std::chrono::time_point< std::chrono::system_clock > | getChronoTimeStamp () const |
The value of the system clock at the time this logging event was created. | |
const LocationInfo & | getLocationInformation () const |
The source code location where the logging request was made. | |
bool | getNDC (LogString &dest) const |
Add the current nested diagnostic context to the end of dest . | |
bool | getMDC (const LogString &key, LogString &dest) const |
Add the value associated with key to the end of dest . | |
KeySet | getMDCKeySet () const |
The keys in the mapped diagnostic context for the event. | |
void | getMDCCopy () const |
Obtain a copy of the current thread's diagnostic context data. | |
void | LoadDC () const |
Obtain a copy of the current thread's diagnostic context data. | |
bool | getProperty (const LogString &key, LogString &dest) const |
Append onto dest the value associated with the property key . | |
KeySet | getPropertyKeySet () const |
The set of of the key values in the properties for the event. | |
void | setProperty (const LogString &key, const LogString &value) |
Associate value with the property key . | |
Public Member Functions inherited from log4cxx::helpers::Object | |
virtual | ~Object () |
virtual const helpers::Class & | getClass () const =0 |
virtual bool | instanceof (const Class &clazz) const =0 |
virtual const void * | cast (const Class &clazz) const =0 |
Static Public Member Functions | |
static log4cxx_time_t | getStartTime () |
The number of microseconds elapsed since 1970-01-01 at the time the application started. | |
The data recorded for each logging request.
Each logging request instantiates a LoggingEvent
instance, which Log4cxx provides to filters, layouts and appenders.
This class is of concern to those wishing to extend log4cxx.
typedef spi::KeySet log4cxx::spi::LoggingEvent::KeySet |
log4cxx::spi::LoggingEvent::LoggingEvent | ( | ) |
An empty event.
log4cxx::spi::LoggingEvent::LoggingEvent | ( | const LogString & | logger, |
const LevelPtr & | level, | ||
const LocationInfo & | location, | ||
LogString && | message | ||
) |
An event composed using the supplied parameters.
logger | The logger used to make the logging request. |
level | The severity of this event. |
location | The source code location of the logging request. |
message | The text to add to this event. |
log4cxx::spi::LoggingEvent::LoggingEvent | ( | const LogString & | logger, |
const LevelPtr & | level, | ||
const LogString & | message, | ||
const LocationInfo & | location | ||
) |
An event composed using the supplied parameters.
logger | The logger used to make the logging request. |
level | The severity of this event. |
message | The text to add to this event. |
location | The source code location of the logging request. |
log4cxx::spi::LoggingEvent::~LoggingEvent | ( | ) |
std::chrono::time_point< std::chrono::system_clock > log4cxx::spi::LoggingEvent::getChronoTimeStamp | ( | ) | const |
The value of the system clock at the time this logging event was created.
const LevelPtr & log4cxx::spi::LoggingEvent::getLevel | ( | ) | const |
The severity level of the logging request that generated this event.
const LocationInfo & log4cxx::spi::LoggingEvent::getLocationInformation | ( | ) | const |
The source code location where the logging request was made.
const LogString & log4cxx::spi::LoggingEvent::getLoggerName | ( | ) | const |
The name of the logger used to make the logging request.
Add the value associated with key
to the end of dest
.
The diagnostic context must have been loaded into this LoggingEvent using LoadDC, to obtain the correct content if the event was generated in a different thread.
key | mapped diagnostic context key value. |
dest | the string to be added to. |
dest
is changed. void log4cxx::spi::LoggingEvent::getMDCCopy | ( | ) | const |
Obtain a copy of the current thread's diagnostic context data.
KeySet log4cxx::spi::LoggingEvent::getMDCKeySet | ( | ) | const |
The keys in the mapped diagnostic context for the event.
const LogString & log4cxx::spi::LoggingEvent::getMessage | ( | ) | const |
The message provided in the logging request.
bool log4cxx::spi::LoggingEvent::getNDC | ( | LogString & | dest | ) | const |
Add the current nested diagnostic context to the end of dest
.
The diagnostic context must have been loaded into this LoggingEvent using LoadDC, to obtain the correct content if the event was generated in a different thread.
dest | the string to be added to. |
dest
is changed. Append onto dest
the value associated with the property key
.
key | the property name. |
dest | the string onto which to associated value is appended. |
dest
was changed. KeySet log4cxx::spi::LoggingEvent::getPropertyKeySet | ( | ) | const |
The set of of the key values in the properties for the event.
const LogString & log4cxx::spi::LoggingEvent::getRenderedMessage | ( | ) | const |
The message provided in the logging request.
|
static |
The number of microseconds elapsed since 1970-01-01 at the time the application started.
const LogString & log4cxx::spi::LoggingEvent::getThreadName | ( | ) | const |
The identity of the thread in which this logging event was created.
const LogString & log4cxx::spi::LoggingEvent::getThreadUserName | ( | ) | const |
The name you gave to the thread in which this logging event was created.
You can create a named thread using log4cxx::helpers::ThreadUtility::createThread. If Log4cxx is unable to retrieve the thread name using a platform-specific call, the value is the same as the thread identity.
log4cxx_time_t log4cxx::spi::LoggingEvent::getTimeStamp | ( | ) | const |
The number of microseconds elapsed since 1970-01-01 at the time this logging event was created.
void log4cxx::spi::LoggingEvent::LoadDC | ( | ) | const |
Obtain a copy of the current thread's diagnostic context data.
The diagnostic context must be loaded to ensure the correct diagnostic context data is available when the event is stored for later use (for example, when the appender uses a different thread to process this event).
Associate value
with the property key
.