Apache log4cxx  Version 0.11.0
log4cxx::varia::FallbackErrorHandler Class Reference

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

#include <fallbackerrorhandler.h>

Inheritance diagram for log4cxx::varia::FallbackErrorHandler:
log4cxx::spi::ErrorHandler log4cxx::helpers::ObjectImpl log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::helpers::Object

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from log4cxx::helpers::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.

Member Function Documentation

◆ setOption()

void log4cxx::varia::FallbackErrorHandler::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 log4cxx::spi::OptionHandler.


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