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

--- Comment #2 from Curt Arnold <[email protected]> 2010-03-19 03:59:14 UTC ---
Bug 45721 introduced configurable ThrowableRenderer's and may be a more general
solution to the issue instead of attempting to do it at layout time.   The
throwable in the ThrowableInformation is not serialized which comes into play
if the converter was used on a logging event that had been deserialized by a
receiver in Chainsaw.  The SocketAppender and similar classes force a call to
getThrowableStringRep() which results in the string representation being
generated before the instance is serialized.  When it deserialized, the
ThrowableInformation has the string representation, but not the Throwable.

>From looking at the code, it would seem that %throwable{compact} would in that
case result in less output than %throwable{short} where normally it is the
other way around.

With the Chainsaw serialization issue, I'd like to avoid introducing anything
into ThrowableInfoPatternConverter that depends on the presence of the
throwable.  Also, I'd like to avoid anything that attempts to parse a stack
trace to find causes, etc.

If you'd always like "compact" rendering in the current SVN HEAD, you can
specify an alternative ThrowableRenderer either in configuration or
programmatically.  I think it is cleaner doing this at that phase, but it
requires writing a ThrowableRenderer and not just  configuration.  If we had a
CompactThrowableRenderer in either extras.jar or log4j.jar, then it would be
back to just a configuration issue.

If you'd like different renderings on different appenders, then we are back at
adding some enhancement to %throwable{}, but I'd be more inclined to support
%throwable{n} to do the first n lines or %throwable{regexp} to output only
those lines that match a regular expression.

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to