我正在迁移到JUnit5(5.3.0-M1)和Log4j2(2.11.0),我想知道是否存在一种简单的方法来处理来自不同线程的日志。
在我以前的版本中,我可以使用CustomFileAppender
来解决它,但是现在我认为可能存在一些更好的解决方案……这个主意是从这样的东西开始:
[date] INFO - test1 - Doing something...
[date] INFO - test2 - Doing something...
[date] INFO - test1 - Doing something...
[date] INFO - test3 - Doing something...
[date] INFO - test1 - Doing something...
[date] INFO - test3 - Doing something...
[date] INFO - test2 - Doing something...
像这样:
[date] INFO - test1 - Doing something...
[date] INFO - test1 - Doing something...
[date] INFO - test1 - Doing something...
[date] INFO - test2 - Doing something...
[date] INFO - test2 - Doing something...
[date] INFO - test3 - Doing something...
[date] INFO - test3 - Doing something...
谢谢!