Linux服务器中带有日志级别着色的tail logback日志文件 [英] tail logback log files with log level coloring in linux server

查看:620
本文介绍了Linux服务器中带有日志级别着色的tail logback日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从log4j迁移到logback,而通过log4j,我们正在使用具有colorcheme的multitail来对日志文件进行日志级别着色. 多重尾可以为logback做同样的事情吗? 有没有其他简单的解决方案来使日志文件尾部带有颜色?

We are migrating from log4j to logback, and with log4j we are using multitail with colorscheme to tail our log files with log level coloring. Can multitail do the same for logback ? is there any other simple solution for logback file tailing with color ?

推荐答案

我不知道默认情况下multitail支持哪些文件格式,但是您可以轻松地创建用于登录的新配色方案(请参见multitail.conf).我添加了当前的log4j colorscheme作为示例:

I don't know what file formats are supported by multitail per default but you can easily create a new color scheme for logback (see multitail.conf). I added the current log4j colorscheme as an example:

colorscheme:log4j
cs_re:magenta::
cs_re:magenta:/
cs_re:blue:^[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*,[0-9]*
cs_re_s:blue,,bold:^[^ ]* *[^,]*,[^ ]* *[0-9]* *(DEBUG) *[^ ]* [^ ]* *(.*)$
cs_re_s:green:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(INFO) *[^ ]* [^ ]* *(.*)$
cs_re_s:yellow:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(WARN) *[^ ]* [^ ]* *(.*)$
cs_re_s:red:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(ERROR) *[^ ]* [^ ]* *(.*)$
cs_re_s:red,,bold:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(FATAL) *[^ ]* [^ ]* *(.*)$
cs_re_s:white,,bold:^[^ ]* *[^,]*,[0-9]* *[0-9]* *[A-Z]* *(.*)

这篇关于Linux服务器中带有日志级别着色的tail logback日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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