java.lang.Object |
↳ |
org.apache.log4j.helpers.OnlyOnceErrorHandler |
Class Overview
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.
Summary
Public Methods |
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, 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.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.apache.log4j.spi.ErrorHandler
abstract
void
|
error(String message)
This method is normally used to just print the error message
passed as a parameter.
|
abstract
void
|
error(String message, Exception e, int errorCode)
|
abstract
void
|
error(String message, Exception e, int errorCode, LoggingEvent event)
This method is invoked to handle the error.
|
abstract
void
|
setAppender(Appender appender)
Set the appender for which errors are handled.
|
abstract
void
|
setBackupAppender(Appender appender)
Set the appender to falkback upon in case of failure.
|
abstract
void
|
setLogger(Logger logger)
Add a reference to a logger to which the failing appender might
be attached to.
|
|
From interface
org.apache.log4j.spi.OptionHandler
abstract
void
|
activateOptions()
Activate the options that were previously set with calls to option
setters.
|
|
Public Constructors
public
OnlyOnceErrorHandler
()
Public Methods
public
void
activateOptions
()
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
.
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. |
event
| The logging event that the failing appender is asked
to log. |
public
void
setAppender
(Appender appender)
public
void
setBackupAppender
(Appender appender)
public
void
setLogger
(Logger logger)
Parameters
logger
| One of the loggers that will be searched for the failing
appender in view of replacement. |