|
Apache Log4cxx
Version 2.0.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) override |
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 | error (const LogString &context, const std::exception &e, spi::ErrorCode category, const spi::LoggingEventPtr &event) override |
Write context and e to stderr and attempt switch to the fallback appender. | |
| void | error (const LogString &context, const std::exception &e, spi::ErrorCode category) override |
Write context and e to stderr and attempt switch to the fallback appender. | |
| void | error (const LogString &message, spi::ErrorCode category) override |
Write message to stderr. | |
| 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 override |
| Has an error been reported? | |
| Public Member Functions inherited from log4cxx::spi::ErrorHandler | |
| virtual | ~ErrorHandler () |
| virtual void | addAppenderHolder (const LogString &name, const AppenderAttachablePtr &clx) |
Override this to add clx to the list of collections to search for the failed appender. | |
| void | activateOptions () override |
| Activate the options that were previously set with calls to option setters. | |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::spi::OptionHandler | |
| virtual | ~OptionHandler () |
| void | activateOptions (helpers::Pool &) |
| virtual void | setOption (const LogString &option, const LogString &value) |
Override this method to set option to value. | |
| 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 | ( | ) |
|
override |
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 |
Write context and e to stderr and attempt switch to the fallback appender.
On the first call to this method, the primary appender is replaced by the backup appender.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Write context and e to stderr and attempt switch to the fallback appender.
On the first call to this method, the primary appender is replaced by the backup appender and event is sent to the backup appender.
Reimplemented from log4cxx::spi::ErrorHandler.
|
overridevirtual |
Write message to stderr.
Implements log4cxx::spi::ErrorHandler.
|
overridevirtual |
Has an error been reported?
Reimplemented from log4cxx::spi::ErrorHandler.
|
overridevirtual |
The appender to which this error handler is attached.
Reimplemented from log4cxx::spi::ErrorHandler.
|
overridevirtual |
Set the backup appender.
Reimplemented from 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.
Reimplemented from log4cxx::spi::ErrorHandler.