logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33717] - Leaving out %throwable in ConversionPattern adds throwable to logging message regardless
Date Fri, 30 Sep 2005 02:20:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33717>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33717





------- Additional Comments From lranatunga@yahoo.com  2005-09-30 04:20 -------
(In reply to comment #0):

We're using an earlier version of log4j (1.2.8) so the following observations
may not be relevant, but have run into the same requirement so wanted to share
our current solution.

The SMTPAppender appears to force the Throwable information to be appended
regardless of the conversion pattern specified.  If the ignoresThrowable()
method of the active layout returns true, the SMTPAppender takes it upon itself
to append the call stack.  See org.apache.log4j.net.SMTPAppender#sendBuffer()
line 220 in 1.2.8 (line 261 on the current 1.3alpha-6 release).  

To solve this problem, we are using our own subclass of PatternLayout which
overrides ignoresThrowable() to return false.

I'm not sure why PatternLayout claims that it ignoresThrowable.  In 1.2.8, a
pattern of %m%n returns the message + call stack - event.getRenderedMessage() is
used instead of event.getMessage().  I'm guessing this was necessary since there
was no pattern token for the throwable info.  

>From your post, it appears there's now a way to include throwable into the
pattern; perhaps the SMTPAppender no longer needs to append the throwable info
itself?

HTH.
lasitha

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

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


Mime
View raw message