Counting repeating lines instead of displaying all of them in log4j2?

╄→гoц情女王★ 提交于 2019-12-12 17:46:37

问题


I have seen a log once that looked like this. Not sure what logging framework generated it.

12:34:56 INFO blah
... previous line repeated 23 times
11:22:33 DEBUG blah

Can this be done with log4j2?


回答1:


The current version, Log4j 2.6.2, does not have this capability. I'm not sure how easy it would be to implement this, but I would definitely recommend that you raise a feature request for this on the Log4j 2 issue tracker.

A similar request may already exist to suppress repeated stack traces, but I think your idea is different enough to warrant a separate Jira ticket.



来源:https://stackoverflow.com/questions/38395844/counting-repeating-lines-instead-of-displaying-all-of-them-in-log4j2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!