logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liesel Reinholdi" <lies...@gmx.net>
Subject Runtime exception in own Appender: change AppenderAttachableImpl?
Date Sun, 26 Mar 2006 16:30:04 GMT
Hi,

we configured an AsyncAppender that appends to our own custom appender
OurAppender.

OurAppender made a runtime exception in the append method. This is nowhere
catched!!!

I took a look at AsyncAppender.java:

     synchronized(container.aai) {
	if(aai != null && event != null) {
	  aai.appendLoopOnAppenders(event);
	}
      }
 
Then I looked at AppenderAttachable.java:

 int appendLoopOnAppenders(LoggingEvent event) {
    int size = 0;
    Appender appender;

    if(appenderList != null) {
      size = appenderList.size();
      for(int i = 0; i < size; i++) {
	appender = (Appender) appenderList.elementAt(i);
	appender.doAppend(event);
      }
    }    
    return size;
  }


Wouldn't it be better to change this code like this:???

 int appendLoopOnAppenders(LoggingEvent event) {
    int size = 0;
    Appender appender;

    if(appenderList != null) {
      size = appenderList.size();
      for(int i = 0; i < size; i++) {
	try {
		appender = (Appender) appenderList.elementAt(i);
		appender.doAppend(event);
	} catch (Exception e) {
		// TODO: ignore (?) or log internally (?)
	}
      }
    }    
    return size;
  }
 

This problem is really fatal because our application running in JBoss hangs
totally!!!


Greets,
Liesel


-- 
"Feel free" mit GMX FreeMail!
Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message