OnlyOnceErrorHandler implements log4cxx's default error handling policy which consists of emitting a message for the first error in an appender and ignoring all following errors.
The error message is printed on System.err.
This policy aims at protecting an otherwise working application from being flooded with error messages when logging fails
Public Member Functions | |
| OnlyOnceErrorHandler () | |
| void | addRef () const |
| void | releaseRef () const |
| void | setLogger (const LoggerPtr &logger) |
| Does not do anything. | |
| 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 &message) const |
Print a the error message passed as parameter on System.err. | |
| void | setAppender (const AppenderPtr &appender) |
| Does not do anything. | |
| void | setBackupAppender (const AppenderPtr &appender) |
| Does not do anything. | |
| void addRef | ( | ) | const [virtual] |
Reimplemented from ObjectImpl.
| void releaseRef | ( | ) | const [virtual] |
Reimplemented from ObjectImpl.
| void setLogger | ( | const LoggerPtr & | logger | ) | [virtual] |
| void activateOptions | ( | log4cxx::helpers::Pool & | p | ) | [virtual] |
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.
| void error | ( | const LogString & | message, | |
| const std::exception & | e, | |||
| int | errorCode | |||
| ) | const [virtual] |
| void error | ( | const LogString & | message, | |
| const std::exception & | e, | |||
| int | errorCode, | |||
| const spi::LoggingEventPtr & | event | |||
| ) | const [virtual] |
| void error | ( | const LogString & | message | ) | const [virtual] |
| void setAppender | ( | const AppenderPtr & | appender | ) | [virtual] |
| void setBackupAppender | ( | const AppenderPtr & | appender | ) | [virtual] |