logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@urbanet.ch>
Subject Re: Error reporting from inside an Appender
Date Mon, 29 Jan 2001 13:32:04 GMT


In the latest log4j release (1.0.4), the FileAppender consistently uses its 
errorHandler to report errors. It uses LogLog.error only once within the 
closeWriterIfOurs method. This method is copied below:

      Close this.writer if opened by setFile or FileAppend(filename..)
   void closeWriterIfOurs() {
     if(this.qwIsOurs && this.qw != null) {
       try {
       catch(java.io.IOException e) {
         LogLog.error("Could not close output stream " + qw, e);

The rationale being that the user probably does not want to trigger a 
possibly heavy error handling mechanism in case of an error while closing a 
java.io.Writer. This is perhaps too smart an approach to do good. However, 
I would hardly call it *madness*. I hope that this makes better sense. Ceki

At 15:05 26.01.2001 -0800, you wrote:
>I was looking at FileAppender for an example of how to report errors
>from inside an
>Appender.  Sometimes it calls errorHandler.error(...) and sometimes
>LogLog.error(...).  Could someone explain the method in this madness?
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

Ceki Gülcü - Independent IT Consultant

av. de Rumine 5            Tel: ++41 21 351 23 15
CH-1005 Lausanne        e-mail: cgu@urbanet.ch  or
Switzerland                     ceki_gulcu@yahoo.com

View raw message