org.jboss.logging.util
Class OnlyOnceErrorHandler

java.lang.Object
  extended byorg.jboss.logging.util.OnlyOnceErrorHandler

public class OnlyOnceErrorHandler
extends java.lang.Object

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 the specified print stream.

This policy aims at protecting an otherwise working application from being flooded with error messages when logging fails.

Since:
0.9.0

Constructor Summary
OnlyOnceErrorHandler()
           
 
Method Summary
 void activateOptions()
          No options to activate.
 void error(java.lang.String message)
          Print a the error message passed as parameter on System.err.
 void error(java.lang.String message, java.lang.Exception e, int errorCode)
          Prints the message and the stack trace of the exception on System.err.
 void error(java.lang.String message, java.lang.Exception e, int errorCode, LoggingEvent event)
          Prints the message and the stack trace of the exception on System.err.
 void setAppender(Appender appender)
          Does not do anything.
 void setBackupAppender(Appender appender)
          Does not do anything.
 void setLogger(Logger logger)
          Does not do anything.
static void setOutput(java.io.PrintStream out)
           
 
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

setOutput

public static void setOutput(java.io.PrintStream out)

setLogger

public void setLogger(Logger logger)
Does not do anything.


activateOptions

public void activateOptions()
No options to activate.


error

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


error

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


error

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


setAppender

public void setAppender(Appender appender)
Does not do anything.


setBackupAppender

public void setBackupAppender(Appender appender)
Does not do anything.