You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2009/04/08 05:54:54 UTC

DO NOT REPLY [Bug 46404] NPE when logging an AxisFault with SocketAppender

https://issues.apache.org/bugzilla/show_bug.cgi?id=46404





--- Comment #7 from Curt Arnold <ca...@apache.org>  2009-04-07 20:54:50 PST ---
Could anyone who has this problem check if the following patch resolves the
issue.  Basically, it forces the evaluation of the message's toString() and the
exception if any's printStackTrace() to occur before the start of
writeObject().


Index: src/main/java/org/apache/log4j/net/SocketAppender.java
===================================================================
--- src/main/java/org/apache/log4j/net/SocketAppender.java    (revision 746252 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=746252 ))
+++ src/main/java/org/apache/log4j/net/SocketAppender.java    (working copy)
@@ -244,6 +244,8 @@
     if (application != null) {
         event.setProperty("application", application);
     }
+    event.getRenderedMessage();
+    event.getThrowableStrRep();
     oos.writeObject(event);
     //LogLog.debug("=========Flushing.");
     oos.flush();

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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