具有并行执行的JUnit5混合日志

时间:2018-07-23 08:35:07

标签: logging parallel-processing log4j2 junit5

我正在迁移到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...

谢谢!

0 个答案:

没有答案