如何停止堆栈跟踪在日志中截断 [英] How do I stop stacktraces truncating in logs
问题描述
导致:java.sql.BatchUpdateException:失败批处理
在org.hsqldb.jdbc.jdbcStatement.executeBatch(jdbcStatement.java:1102)
在org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(jdbcPreparedStatement.java:514)
在org。 hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
在org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 113更多
<有没有人知道如何获得完整的堆栈跟踪显示(即显示其他113行)?
JavaDocs(for Java 7) Throwable有一个非常详细的解释发生了什么。
解决方案当您看到... 113更多时,这意味着剩下的一行引起的异常与父例外的那一点的剩余行相同。
例如,你将有
com.something.XyzException
at ...
at ...
在org.hibernate.jdbc .AbstractBatcher.executeBatch(AbstractBatcher.java:242)
在...<其他113行在这里> ...
导致:<以上>。
在AbstractBatcher.executeBatch,第242行的两个堆栈跟踪meet,然后从向上调用跟踪与包装异常相同。
Lots of times in Java logs I'll get something like:
Caused by: java.sql.BatchUpdateException: failed batch
at org.hsqldb.jdbc.jdbcStatement.executeBatch(jdbcStatement.java:1102)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(jdbcPreparedStatement.java:514)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 113 more
Does anyone know how to get the full stacktrace showing (i.e. show the other 113 lines)?
The JavaDocs (for Java 7) for Throwable have a pretty detailed explanation of what's going on.
解决方案 When you see '...113 more', that means that the remaining lines of the 'caused by' exception are identical to the remaining lines from that point on of the parent exception.
For example, you'll have
com.something.XyzException
at ...
at ...
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at ... <the other 113 lines are here>...
Caused by: <the above>.
The two stack traces 'meet' at AbstractBatcher.executeBatch, line 242, and then from then on the upward call trace is the same as the wrapping exception.
这篇关于如何停止堆栈跟踪在日志中截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!