|
Apache Log4cxx
Version 2.0.0
|
Appenders may delegate their error handling to ErrorHandlers.
More...
#include <errorhandler.h>
Public Member Functions | |
| 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. | |
| virtual void | setLogger (const LoggerPtr &logger) |
| Override this to add a reference to a logger to which the failing appender might be attached. | |
| virtual void | error (const LogString &context, const std::exception &e, ErrorCode category=ErrorCode::GENERIC_FAILURE)=0 |
| This method is invoked when an exception is thown. | |
| virtual void | error (const LogString &message, ErrorCode category=ErrorCode::INVALID_CONFIGURATION)=0 |
| This method is invoked when an error is detected but an exception is not available (e.g. | |
| virtual void | error (const LogString &context, const std::exception &e, ErrorCode category, const LoggingEventPtr &event) |
| This method is invoked when an exception is thown while processing a spi::LoggingEvent. | |
| virtual void | setAppender (const AppenderPtr &appender) |
| Override this to set the appender holding this error handler. | |
| virtual void | setBackupAppender (const AppenderPtr &appender) |
| Override this to set the appender to fallback upon in case of failure. | |
| virtual bool | errorReported () const |
| Override this to report whether an error been raised to this reporter. | |
| 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 |
Appenders may delegate their error handling to ErrorHandlers.
Error handling is a particularly tedious to get right because by definition errors are hard to predict and to reproduce.
Please take the time to contact the author in case you discover that errors are not properly handled. You are most welcome to suggest new error handling policies or criticize existing policies.
|
inlinevirtual |
|
overridevirtual |
Activate the options that were previously set with calls to option setters.
No action is performed in this implementation.
Implements log4cxx::spi::OptionHandler.
|
virtual |
Override this to add clx to the list of collections to search for the failed appender.
| name | the collection name. |
| clx | has a collection of appenders. |
|
virtual |
This method is invoked when an exception is thown while processing a spi::LoggingEvent.
The default implementation discards event and calls the other error() overload.
| context | Contextual information from where the exception is caught |
| e | The execption that was caught. |
| category | The category of error. |
| event | The logging event that was not output |
Reimplemented in log4cxx::varia::FallbackErrorHandler.
|
pure virtual |
This method is invoked when an exception is thown.
| context | Contextual information from where the exception is caught |
| e | The execption that was caught. |
| category | The category of error. |
Implemented in log4cxx::helpers::OnlyOnceErrorHandler, and log4cxx::varia::FallbackErrorHandler.
|
pure virtual |
This method is invoked when an error is detected but an exception is not available (e.g.
Log4cxx is incorrectly configured).
Implemented in log4cxx::helpers::OnlyOnceErrorHandler, and log4cxx::varia::FallbackErrorHandler.
|
virtual |
Override this to report whether an error been raised to this reporter.
This implementation returns false always.
Reimplemented in log4cxx::helpers::OnlyOnceErrorHandler, and log4cxx::varia::FallbackErrorHandler.
|
virtual |
Override this to set the appender holding this error handler.
This method is called by a xml::DOMConfigurator file processor when the error handler is associated with an appender.
Reimplemented in log4cxx::varia::FallbackErrorHandler.
|
virtual |
Override this to set the appender to fallback upon in case of failure.
This method is called by the xml::DOMConfigurator file processor when the error handler is associated with an appender.
Reimplemented in log4cxx::varia::FallbackErrorHandler.
|
virtual |
Override this to add a reference to a logger to which the failing appender might be attached.
The failing appender can be searched and replaced only in the loggers you add through this method.
| logger | One of the loggers that will be searched. |
Reimplemented in log4cxx::varia::FallbackErrorHandler.