By using log4j, we have encountered a problem related to the DefaultRenderer (this problem may be solved/ answered yet, but we did not found any comment). Why do you not catch a Throwable thrown in toString of a message Object? We would prefer a solution that emits e.g. a warn(ing) message indicating the Throwable trace instead of crashing the application. Otherwise, an application could run several months rendering HashMaps every day, crashing one day because of a ConcurrentModificationException. Of course, this app is incorrectly synchronized but we do not want crashes because of logging anyway. The following adaption could be included instead:
public class TryCatchDefaultRenderer implements ObjectRenderer {
final static String throwableWarnMsg =
"some msg";
private static Logger log = Logger.getLogger(TryCatchDefaultRenderer.class);
public String doRender(Object o) { String result = null; try { result = o.toString(); } // we catch any Throwable catch (Throwable t) { log.warn(throwableWarnMsg, t); } return result; }
}
We would be interested in your opinion Thanks, Peter
PS: Do you intend including entering/exiting signatures?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]