FallbackErrorHandler Class Reference

The `FallbackErrorHandler` implements the ErrorHandler interface such that a secondary appender may be specified. More...

Inheritance diagram for FallbackErrorHandler:

## Public Member Functions

| 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. More...
void | activateOptions (log4cxx::helpers::Pool &p)
| No options to activate. More...
void | setOption (const LogString &option, const LogString &value)
| Set `option` to `value`. More...
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`. More...
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`. More...
void | error (const LogString &) const
| Print a the error message passed as parameter on `System.err`. More...
const AppenderPtr & | getBackupAppender () const
| Return the backup appender. More...
void | setAppender (const AppenderPtr &primary)
| The appender to which this error handler is attached. More...
void | setBackupAppender (const AppenderPtr &backup)
| Set the backup appender. More...
Public Member Functions inherited from ErrorHandler
virtual | ~ErrorHandler ()
Public Member Functions inherited from OptionHandler
virtual | ~OptionHandler ()
Public Member Functions inherited from Object
virtual const helpers::Class & | getClass () const
virtual | ~Object ()
virtual bool | instanceof (const Class &clazz) const =0
virtual const void * | cast (const Class &clazz) const =0
Public Member Functions inherited from ObjectImpl
| ObjectImpl ()
virtual | ~ObjectImpl ()

## Additional Inherited Members

Static Public Member Functions inherited from Object
static const helpers::Class & | getStaticClass ()
static const log4cxx::helpers::ClassRegistration & | registerClass ()
Protected Attributes inherited from ObjectImpl
unsigned int volatile | ref

## Detailed Description

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.

## Constructor & Destructor Documentation

## FallbackErrorHandler()

FallbackErrorHandler | ( |  | ) |

## Member Function Documentation

## activateOptions()

void activateOptions | ( | log4cxx::helpers::Pool & | p | ) |

virtual

No options to activate.

Implements OptionHandler.

## addRef()

void addRef | ( |  | ) | const

virtual

Reimplemented from ObjectImpl.

## error() [1/3]

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.

## error() [2/3]

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.

## error() [3/3]

void error | ( | const LogString & |  | ) | const

inline virtual

Print a the error message passed as parameter on `System.err`.

Implements ErrorHandler.

## getBackupAppender()

const AppenderPtr& getBackupAppender | ( |  | ) | const

inline

Return the backup appender.

## releaseRef()

void releaseRef | ( |  | ) | const

virtual

Reimplemented from ObjectImpl.

## setAppender()

void setAppender | ( | const AppenderPtr & | primary | ) |

virtual

The appender to which this error handler is attached.

Implements ErrorHandler.

## setBackupAppender()

void setBackupAppender | ( | const AppenderPtr & | backup | ) |

virtual

Set the backup appender.

Implements ErrorHandler.

## setLogger()

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.

## setOption()

void setOption | ( | const LogString & | option,
|  | const LogString & | value
| ) |  |

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.

The documentation for this class was generated from the following file:

- fallbackerrorhandler.h