logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Kemp" <mattk...@gmail.com>
Subject Re: FileAppender Truncates Stack Trace
Date Wed, 23 Apr 2008 20:28:21 GMT
You can create your own custom object renderer that will properly render the
whole stack trace. This renderer will need to be included in the log4j
config and be available on the classpath when log4j initializes.


On Wed, Apr 23, 2008 at 3:19 PM, Robert Pepersack <
RPepersack@mdinsurance.state.md.us> wrote:

> Hello,
>
> I'm using FileAppender to log to a log file.  When an exception gets
> caught and printed, the stack trace is truncated as it usually is by
> default:
>
> Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Attempt to insert NULL
> value into column 'id', table 'table'; column does not allow nulls. Update
> fails.
>
>        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
>        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
>        at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
>        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
>        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
>        at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source)
>        at com.sybase.jdbc3.jdbc.SybCallableStatement.executeQuery(Unknown
> Source)
>        at miaJs.jdbc.JdbcFacade.executeQuery(JdbcFacade.java:977)
>        ... 14 more
>
> Instead of  the "... 14 more" at the bottom, I would like to see the
> entire stack trace.  I know how to get Java to do this by using
> Throwable.getStackTrace(), and then loop through the array of
> StackTraceElements.  I looked in the log4j source code.  I think that
> FileAppender uses the OnlyOnceErrorHandler in its super, superclass
> AppenderSkeleton.  It looks like OnlyOnceErrorHandler uses LogLog.  But, I'm
> not sure how to get log4j to print the entire stack trace.
>
> Thanks,
>
> Bob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message