The FallbackErrorHandler
implements the ErrorHandler interface such that a secondary appender may be specified.
More...
Inherits log4cxx::spi::ErrorHandler, and log4cxx::helpers::ObjectImpl.
Classes | |
class | ClazzFallbackErrorHandler |
Public Member Functions | |
virtual const helpers::Class & | getClass () const |
const void * | cast (const helpers::Class &clazz) const |
bool | instanceof (const helpers::Class &clazz) const |
FallbackErrorHandler () | |
void | addRef () const |
void | releaseRef () const |
void | setLogger (const LoggerPtr &logger) |
Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure. | |
void | activateOptions (log4cxx::helpers::Pool &p) |
No options to activate. | |
void | setOption (const LogString &option, const LogString &value) |
Set option to value . | |
void | error (const LogString &message, const std::exception &e, int errorCode) const |
Prints the message and the stack trace of the exception on System.err . | |
void | error (const LogString &message, const std::exception &e, int errorCode, const spi::LoggingEventPtr &event) const |
Prints the message and the stack trace of the exception on System.err . | |
void | error (const LogString &) const |
Print a the error message passed as parameter on System.err . | |
const AppenderPtr & | getBackupAppender () const |
Return the backup appender. | |
void | setAppender (const AppenderPtr &primary) |
The appender to which this error handler is attached. | |
void | setBackupAppender (const AppenderPtr &backup) |
Set the backup appender. | |
Static Public Member Functions | |
static const helpers::Class & | getStaticClass () |
static const log4cxx::helpers::ClassRegistration & | registerClass () |
The FallbackErrorHandler
implements the ErrorHandler interface such that a secondary appender may be specified.
This secondary appender takes over if the primary appender fails for whatever reason.
The error message is printed on System.err
, and logged in the new secondary appender.
void activateOptions | ( | log4cxx::helpers::Pool & | p | ) | [virtual] |
No options to activate.
Implements OptionHandler.
void addRef | ( | ) | const [virtual] |
Reimplemented from ObjectImpl.
const void* cast | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Implements Object.
void error | ( | const LogString & | ) | const [inline, virtual] |
Print a the error message passed as parameter on System.err
.
Implements ErrorHandler.
void error | ( | const LogString & | message, | |
const std::exception & | e, | |||
int | errorCode, | |||
const spi::LoggingEventPtr & | event | |||
) | const [virtual] |
Prints the message and the stack trace of the exception on System.err
.
Implements ErrorHandler.
void error | ( | const LogString & | message, | |
const std::exception & | e, | |||
int | errorCode | |||
) | const [virtual] |
Prints the message and the stack trace of the exception on System.err
.
Implements ErrorHandler.
const AppenderPtr& getBackupAppender | ( | ) | const [inline] |
Return the backup appender.
virtual const helpers::Class& getClass | ( | ) | const [virtual] |
Reimplemented from ErrorHandler.
static const helpers::Class& getStaticClass | ( | ) | [static] |
Reimplemented from ErrorHandler.
bool instanceof | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Implements Object.
static const log4cxx::helpers::ClassRegistration& registerClass | ( | ) | [static] |
Reimplemented from ErrorHandler.
void releaseRef | ( | ) | const [virtual] |
Reimplemented from ObjectImpl.
void setAppender | ( | const AppenderPtr & | primary | ) | [virtual] |
The appender to which this error handler is attached.
Implements ErrorHandler.
void setBackupAppender | ( | const AppenderPtr & | backup | ) | [virtual] |
Set the backup appender.
Implements ErrorHandler.
void setLogger | ( | const LoggerPtr & | logger | ) | [virtual] |
Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure.
Implements ErrorHandler.
Set option
to value
.
The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.
Implements OptionHandler.