Log4j 1.1.3

org.apache.log4j.helpers
Class OnlyOnceErrorHandler

java.lang.Object
  |
  +--org.apache.log4j.helpers.OnlyOnceErrorHandler
All Implemented Interfaces:
ErrorHandler, OptionHandler

public class OnlyOnceErrorHandler
extends Object
implements 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.

Since:
0.9.0
Author:
Ceki Gülcü

Constructor Summary
OnlyOnceErrorHandler()
           
 
Method Summary
 void activateOptions()
          No options to activate.
 void error(String message)
          Print a the error message passed as parameter on System.err.
 void error(String message, Exception e, int errorCode)
          Prints the message and the stack trace of the exception on System.err.
 String[] getOptionStrings()
          Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.
 void setOption(String key, String value)
          Deprecated. Use the setter method for the option directly instead of the generic setOption method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnlyOnceErrorHandler

public OnlyOnceErrorHandler()
Method Detail

getOptionStrings

public String[] getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.

Returns null as OnlyOnceErrorHandler has no options.
Specified by:
getOptionStrings in interface OptionHandler

setOption

public void setOption(String key,
                      String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method.

No options to set.
Specified by:
setOption in interface OptionHandler

activateOptions

public void activateOptions()
No options to activate.
Specified by:
activateOptions in interface OptionHandler

error

public void error(String message,
                  Exception e,
                  int errorCode)
Prints the message and the stack trace of the exception on System.err.
Specified by:
error in interface ErrorHandler
Following copied from interface: org.apache.log4j.spi.ErrorHandler
Parameters:
message - The message assoicated with the error.
e - The Exption that was thrown when the error occured.
errorCode - The error code associated with the error.

error

public void error(String message)
Print a the error message passed as parameter on System.err.
Specified by:
error in interface ErrorHandler

Log4j 1.1.3

Please notify me about new log4j releases.