log4j:如何获取最后插入的日志消息? [英] log4j: how to get the last inserted log message?

查看:119
本文介绍了log4j:如何获取最后插入的日志消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法将最后插入的日志检索到我的log4j日志文件中? 另外,我需要在Spock上进行单元测试时运行它.

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.

谢谢!

推荐答案

您始终可以在日志消息通过的地方编写自己的附加程序:

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

获取实时Log4J消息

这篇关于log4j:如何获取最后插入的日志消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆