Apache log4cxx  Version 0.12.0
log4cxx::helpers::OnlyOnceErrorHandler Class Reference

The 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. More...

#include <onlyonceerrorhandler.h>

Inheritance diagram for log4cxx::helpers::OnlyOnceErrorHandler:
log4cxx::spi::ErrorHandler log4cxx::helpers::Object log4cxx::spi::OptionHandler log4cxx::helpers::Object

Public Member Functions

 OnlyOnceErrorHandler ()
 
void setLogger (const LoggerPtr &logger)
 Does not do anything. 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 &message) const
 Print a the error message passed as parameter on System.err. More...
 
void setAppender (const AppenderPtr &appender)
 Does not do anything. More...
 
void setBackupAppender (const AppenderPtr &appender)
 Does not do anything. More...
 
- Public Member Functions inherited from log4cxx::spi::ErrorHandler
virtual ~ErrorHandler ()
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Detailed Description

The 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

Constructor & Destructor Documentation

◆ OnlyOnceErrorHandler()

log4cxx::helpers::OnlyOnceErrorHandler::OnlyOnceErrorHandler ( )

Member Function Documentation

◆ activateOptions()

void log4cxx::helpers::OnlyOnceErrorHandler::activateOptions ( log4cxx::helpers::Pool p)
virtual

No options to activate.

Implements log4cxx::spi::OptionHandler.

◆ error() [1/3]

void log4cxx::helpers::OnlyOnceErrorHandler::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 log4cxx::spi::ErrorHandler.

◆ error() [2/3]

void log4cxx::helpers::OnlyOnceErrorHandler::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 log4cxx::spi::ErrorHandler.

◆ error() [3/3]

void log4cxx::helpers::OnlyOnceErrorHandler::error ( const LogString message) const
virtual

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

Implements log4cxx::spi::ErrorHandler.

◆ setAppender()

void log4cxx::helpers::OnlyOnceErrorHandler::setAppender ( const AppenderPtr appender)
virtual

Does not do anything.

Implements log4cxx::spi::ErrorHandler.

◆ setBackupAppender()

void log4cxx::helpers::OnlyOnceErrorHandler::setBackupAppender ( const AppenderPtr appender)
virtual

Does not do anything.

Implements log4cxx::spi::ErrorHandler.

◆ setLogger()

void log4cxx::helpers::OnlyOnceErrorHandler::setLogger ( const LoggerPtr logger)
virtual

Does not do anything.

Implements log4cxx::spi::ErrorHandler.

◆ setOption()

void log4cxx::helpers::OnlyOnceErrorHandler::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: