问题描述
我曾经看到过一个如下的日志.不确定生成了什么日志记录框架.
12:34:56 INFO blah ... previous line repeated 23 times 11:22:33 DEBUG blah
可以使用log4j2?
完成推荐答案
当前版本log4j 2.6.2没有此功能.我不确定实施此功能有多容易,但是我绝对建议您在 log4j 2问题跟踪器.
可能已经存在类似的请求来抑制重复的堆栈跟踪,但是我认为您的想法足够不同,可以保证单独的JIRA票.
问题描述
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?
推荐答案
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.