You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by François Archambault <fr...@netappsid.com> on 2005/08/25 21:27:18 UTC

How to use ErrorHandler

Hi,

 

I am new to Log4j and I am trying to manage all errors that occurs in my application. I would like to show them in a JList as a list of error.  I am not sure if it is the right way to do it, but I have implemented org.apache.log4j.spi.ErrorHandler in my class and now I'm trying to receive logs from it. I have the following properties file : 

 

### direct log messages to stdout ###

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.Target=System.out

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

 

==> log4j.appender.stdout.errorHandler=com.netappsid.client.gui.Workbench

 

log4j.rootLogger=warn, stdout

 

The pointed line is where I have my problem. I am trying to tell to the appender "stdout" to dispatch his errors to my Workbench, but I got the following error : 

log4j:WARN Failed to set property [errorHandler] to value "com.netappsid.client.gui.Workbench".

 

I guess I am not using it properly. Can someone help me out on that one ?

 

Thanks in advance

 

Francois Archambault