Java – format slf4j to record message types using colors

I am using slf4j to log in to my java application It involves a large number of logs and log monitoring

Any suggestion or help is welcome Day thnx

Solution

I came up with two solutions They are not colors, but alternative solutions:

>In the file appender configuration, you can configure the mode to include log levels (errors, warnings, etc.) Then you can use the grep file to filter messages by level. > You can configure two file Appenders (two separate log files) for different levels of thresholds For example, you can record all logs above the debug level (so info, warn, error), that is, logs Txt, while the other will only log errors to errors txt

I hope it helps

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>