【发布时间】:2020-02-01 03:52:05
【问题描述】:
我已为多线程应用程序启用 log4j 日志记录,这使得日志文件难以分析。
日志文件看起来像
2019-10-02 07:49:55:DEBUG :Main: Start of the call
2019-10-02 07:49:55:DEBUG :pool-1-thread-4: Running in pool-1-thread-4
2019-10-02 07:49:55:DEBUG :pool-1-thread-2: Running in pool-1-thread-2
2019-10-02 07:49:55:DEBUG :pool-1-thread-4: Running in pool-1-thread-4
我们可以在记录时或至少在解析日志文件后根据线程 ID 对日志进行分组吗?
【问题讨论】:
标签: java multithreading logging log4j