|
Apache Log4cxx
Version 1.7.0
|
The FallbackErrorHandler implements the ErrorHandler interface such that a secondary appender may be specified.
More...
#include <fallbackerrorhandler.h>
Public Member Functions | |
| FallbackErrorHandler () | |
| ~FallbackErrorHandler () | |
| void | addAppenderHolder (const LogString &name, const spi::AppenderAttachablePtr &clx) LOG4CXX_16_VIRTUAL_SPECIFIER |
Add clx to the list of collections to search for the failed appender. | |
| void | setLogger (const LoggerPtr &logger) override |
| Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure. | |
| void | activateOptions (helpers::Pool &p) override |
| Activate the options that were previously set with calls to option setters. | |
| void | setOption (const LogString &option, const LogString &value) override |
Set option to value. | |
| void | error (const LogString &message, const std::exception &e, int errorCode) const override |
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 override |
Prints the message and the stack trace of the exception on System.err. | |
| void | error (const LogString &message) const override |
Print a the error message passed as parameter on System.err. | |
| void | setAppender (const AppenderPtr &primary) override |
| The appender to which this error handler is attached. | |
| void | setBackupAppender (const AppenderPtr &backup) override |
| Set the backup appender. | |
| bool | errorReported () const |
| Has an error been reported? | |
| Public Member Functions inherited from log4cxx::spi::ErrorHandler | |
| virtual | ~ErrorHandler () |
| Public Member Functions inherited from log4cxx::spi::OptionHandler | |
| virtual | ~OptionHandler () |
| 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 |
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.
Here is a sample configuration file that installs this error handler:
| log4cxx::varia::FallbackErrorHandler::FallbackErrorHandler | ( | ) |
| log4cxx::varia::FallbackErrorHandler::~FallbackErrorHandler | ( | ) |
|
overridevirtual |
Activate the options that were previously set with calls to option setters.
No action is performed in this implementation.
Implements log4cxx::spi::OptionHandler.
| void log4cxx::varia::FallbackErrorHandler::addAppenderHolder | ( | const LogString & | name, |
| const spi::AppenderAttachablePtr & | clx ) |
Add clx to the list of collections to search for the failed appender.
| name | used in log messages. |
| clx | has a collection of appenders. |
|
overridevirtual |
Print a the error message passed as parameter on System.err.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Prints the message and the stack trace of the exception on System.err.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Prints the message and the stack trace of the exception on System.err.
Implements log4cxx::spi::ErrorHandler.
| bool log4cxx::varia::FallbackErrorHandler::errorReported | ( | ) | const |
Has an error been reported?
|
overridevirtual |
The appender to which this error handler is attached.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Set the backup appender.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Set option to value.
Implements log4cxx::spi::OptionHandler.