Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.logging.util
Class OnlyOnceErrorHandler

    java.lang.Object
      org.jboss.logging.util.OnlyOnceErrorHandler

All Implemented Interfaces:
  org.apache.log4j.spi.ErrorHandler, org.apache.log4j.spi.OptionHandler

public class OnlyOnceErrorHandler
extends Object
implements org.apache.log4j.spi.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 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
Author:
  Ceki Gülcü, Adrian Brock (adrian@jboss.org);

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`.
`void` | `error(String message, Exception e, int errorCode, org.apache.log4j.spi.LoggingEvent event)` Prints the message and the stack trace of the exception on `System.err`.
`void` | `setAppender(org.apache.log4j.Appender appender)` Does not do anything.
`void` | `setBackupAppender(org.apache.log4j.Appender appender)` Does not do anything.
`void` | `setLogger(org.apache.log4j.Logger logger)` Does not do anything.
`static void` | `setOutput(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(PrintStream out)

### setLogger

    public void setLogger(org.apache.log4j.Logger logger)

  Does not do anything.

  Specified by:
    `setLogger` in interface `org.apache.log4j.spi.ErrorHandler`

### activateOptions

    public void activateOptions()

  No options to activate.

  Specified by:
    `activateOptions` in interface `org.apache.log4j.spi.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 `org.apache.log4j.spi.ErrorHandler`

### error

    public void error(String message,
                      Exception e,
                      int errorCode,
                      org.apache.log4j.spi.LoggingEvent event)

  Prints the message and the stack trace of the exception on `System.err`.

  Specified by:
    `error` in interface `org.apache.log4j.spi.ErrorHandler`

### error

    public void error(String message)

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

  Specified by:
    `error` in interface `org.apache.log4j.spi.ErrorHandler`

### setAppender

    public void setAppender(org.apache.log4j.Appender appender)

  Does not do anything.

  Specified by:
    `setAppender` in interface `org.apache.log4j.spi.ErrorHandler`

### setBackupAppender

    public void setBackupAppender(org.apache.log4j.Appender appender)

  Does not do anything.

  Specified by:
    `setBackupAppender` in interface `org.apache.log4j.spi.ErrorHandler`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.