0

I have a requirement now, when log4js is printing logs, I need to get the current real-time log data, a complete piece of log information (log4js processed).Does log4js has such an interface?

logger.error("Cheese is too ripe!");

When the code is executed,I get

[2020-07-15T11:19:07.452] [ERROR] cheese - Cheese is too ripe!

How can I get this whole string from log4js in my code rather than 'Cheese is too ripe'

神应歌
  • 1
  • 1

1 Answers1

0

I just find a way to solve it by use recording appender. Use replay and layout method to make the same log sentence.

神应歌
  • 1
  • 1