logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Pepersack" <RPepers...@mdinsurance.state.md.us>
Subject FileAppender Truncates Stack Trace
Date Wed, 23 Apr 2008 20:19:11 GMT

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.



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

View raw message