问题
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