org.apache.log4j.varia

Class FallbackErrorHandler

public class FallbackErrorHandler extends Object implements ErrorHandler

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.

Author: Ceki Gücü

Constructor Summary
FallbackErrorHandler()
Method Summary
voidactivateOptions()
No options to activate.
voiderror(String message, Exception e, int errorCode)
Prints the message and the stack trace of the exception on System.err.
voiderror(String message, Exception e, int errorCode, LoggingEvent event)
Prints the message and the stack trace of the exception on System.err.
voiderror(String message)
Print a the error message passed as parameter on System.err.
voidsetAppender(Appender primary)
The appender to which this error handler is attached.
voidsetBackupAppender(Appender backup)
Set the backup appender.
voidsetLogger(Logger logger)
Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure.

Constructor Detail

FallbackErrorHandler

public FallbackErrorHandler()

Method Detail

activateOptions

public void activateOptions()
No options to activate.

error

public void error(String message, Exception e, int errorCode)
Prints the message and the stack trace of the exception on System.err.

error

public void error(String message, Exception e, int errorCode, LoggingEvent event)
Prints the message and the stack trace of the exception on System.err.

error

public void error(String message)
Print a the error message passed as parameter on System.err.

setAppender

public void setAppender(Appender primary)
The appender to which this error handler is attached.

setBackupAppender

public void setBackupAppender(Appender backup)
Set the backup appender.

setLogger

public void setLogger(Logger logger)
Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure.
Copyright 2000-2005 Apache Software Foundation.