我现在有一个要求,当log4js打印日志时,我需要获取当前的实时日志数据,一条完整的日志信息(经过log4js处理).Does log4js有这样的接口吗?
logger.error("Cheese is too ripe!");
当代码执行时,我会得到
[2020-07-15T11:19:07.452] [ERROR] cheese - Cheese is too ripe!
我如何在我的代码中从log4js中获得整个字符串,而不是'Cheese is too rather‘
发布于 2020-09-28 08:30:56
我只是通过使用记录附加器找到了一种解决方法。使用replay和layout方法制作相同的日志语句。
https://stackoverflow.com/questions/62916830
复制相似问题