logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Godmar Back <god...@gmail.com>
Subject Re: Q: how to prevent log4j from cutting off stack traces?
Date Fri, 12 Feb 2010 05:41:50 GMT
Thank you for the help.

After grepping through the log4j code, I downloaded Apache juli, then
all logging classes in Tomcat, without success in finding the issue.
That left only the web application - I finally found the problem was
with the ZK (zkoss.org) framework (*), which renders the stack trace
to a string before passing it on to the logger. They cut it off at
depth 6 in certain cases.

Unfortunately, it's not possible to tell from the log whether the
stacktrace was rendered by the logging framework or not. (That may
actually a suggestion for improvement: provide a formatting mode that
clearly distinguishes strings from stack traces rendered by the
logger, for instance, by prefixing each line of a string with a
certain marker.)

 - Godmar

(*) http://www.zkoss.org/javadoc/3.6/zk/org/zkoss/lang/Exceptions.html#getBriefStackTrace%28java.lang.Throwable%29

On Fri, Feb 12, 2010 at 12:16 AM, Curt Arnold <carnold@apache.org> wrote:
> Unless the user has configured otherwise, log4j just outputs the results of Exception.printStackTrace(Writer).
 Any truncation occurs within the implementation of printStackTrace, likely way back in the
JVM and could be controlled by any configuration supported by the JVM.  However, I was not
able to find any command line arguments or similar to tweak that behavior.
>
> In the SVN HEAD, the throwable renderer is configurable and EnhancedThrowableRenderer
uses Exception.getStackTrace instead which may not be affected by stack trace truncation.
>
>
>
> log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
>
> or
>
> <throwableRenderer class="org.apache.log4j.EnhancedThrowableRenderer"/>
>
> to log4j.properties or log4j.xml respectively.
>
> See http://issues.apache.org/bugzilla/show_bug.cgi?id=45721 for the backstory.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

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


Mime
View raw message