log4j: how to get the last inserted log message?

China☆狼群 提交于 2019-12-11 07:44:52

问题


I wonder if there is way to retrieve the last inserted log to my log4j log file ? Also, I need it to be run while unit-testing on Spock.

Thanks!


回答1:


You can always write your own appender where log messages go through:

Get live Log4J messages



来源:https://stackoverflow.com/questions/26533121/log4j-how-to-get-the-last-inserted-log-message

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