为什么 log4j 在(大量)重复相同异常后禁用堆栈跟踪?
在我们的一个客户安装中,我们发生了数千次相同的异常。 在大量记录良好的堆栈跟踪(9332)之后,仍然记录异常的发生,但没有堆栈跟踪。 重新启动 java 进程后,同样的事情发生:这次我们有 17858 个堆栈跟踪,然后只有异常发生本身。
有一个类似的问题 这里,但没有答案...
这是 log4j 功能还是错误? (我相信前者,因为我真的很喜欢那些阿帕奇人所做的事情)
有什么想法吗?
At one of our customer installations we had thousands of occurrences of the same exception. After a lot of well logged stacktraces (9332) the occurrence of the exception is still logged, but without stacktrace. After restarting the java process, the same thing: This time we had 17858 stacktraces and then only the exception occurrence itself.
There is a similar question here, but no answer...
Is it a log4j feature or bug? (I believe in the former, because I really like, what those apache guys do)
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Java 5 或更好的版本?
然后你会看到:
由 Java 5 发行说明。
Using Java 5 or better?
Then you're seeing:
Courtesy of the Java 5 release notes.
对我来说听起来像是一个功能,至少如果堆栈跟踪确实相同的话。 为什么您想让日志变得更大(从而更难搜索)而不获取更多信息? 将检查此功能的可配置性...
编辑:我查看了 log4j 代码,但没有任何痕迹。 这强烈表明罗伯特的答案是正确的。 IMO 不错的虚拟机功能:)
Sounds like a feature to me, at least if the stack traces really are identical. Why would you want to make your logs bigger (and thus harder to search) without getting any more information? Will check for configurability of this feature...
EDIT: I've had a look through the log4j code and there's no trace of it. This would strongly suggest that Robert's answer is correct. Nice VM feature IMO :)