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 Liesel Reinholdi <li...@gmx.net> on 2006/03/26 18:30:04 UTC

Runtime exception in own Appender: change AppenderAttachableImpl?

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