Save This Page
Home » slf4j-1.5.5 » org.apache » log4j » helpers » [javadoc | source]
org.apache.log4j.helpers
public class: OnlyOnceErrorHandler [javadoc | source]
java.lang.Object
   org.apache.log4j.helpers.OnlyOnceErrorHandler

All Implemented Interfaces:
    ErrorHandler

The OnlyOnceErrorHandler implements log4j'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.

Field Summary
final  String WARN_PREFIX     
final  String ERROR_PREFIX     
 boolean firstTime     
Method from org.apache.log4j.helpers.OnlyOnceErrorHandler Summary:
activateOptions,   error,   error,   error,   setAppender,   setBackupAppender,   setLogger
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.log4j.helpers.OnlyOnceErrorHandler Detail:
 public  void activateOptions() 
    No options to activate.
 public  void error(String message) 
    Print a the error message passed as parameter on System.err.
 public  void error(String message,
    Exception e,
    int errorCode) 
    Prints the message and the stack trace of the exception on System.err.
 public  void error(String message,
    Exception e,
    int errorCode,
    LoggingEvent event) 
    Prints the message and the stack trace of the exception on System.err.
 public  void setAppender(Appender appender) 
    Does not do anything.
 public  void setBackupAppender(Appender appender) 
    Does not do anything.
 public  void setLogger(Logger logger) 
    Does not do anything.