如何为 Wildfly 的日志着色 - Eclipse 上的 Jboss Server 控制台 [英] how to color the log of Wildfly - Jboss Server console on Eclipse
问题描述
我正在使用服务器 Wildfly 版本 18.0.0,并且我想在启动时为服务器的日志着色 我使用 Eclipse 作为 IDE.就像 tomcat 服务器警告,信息......如何做到这一点?
I am using server Wildfly version 18.0.0 and I want to color the log of my server while starting I am using Eclipse as IDE. just like tomcat server Warn, Info.... How to do that?
推荐答案
在 Eclipse 控制台中为 Wildfly 日志着色
在控制台中安装 ANSI Escape 控制台 来自 Eclipse Marketplace 的插件:https://marketplace.eclipse.org/content/ansi-escape-console
您可能需要从 Wildfly 服务器启动配置中设置或更改 -Dorg.jboss.logmanager.nocolor=true
VM 参数.要改变它:
You may have to set or change the -Dorg.jboss.logmanager.nocolor=true
VM argument from Wildfly server launch configuration.
To change it you:
转到服务器"标签
右键单击 Wildlfy 服务器
Right click on the Wildlfy server
选择打开
菜单项
在显示的概览标签,一般信息部分,点击打开启动配置
In the displayed Overview tab, section General information, click on Open launch configuration
在 Edit Configuration 对话框中,编辑 VM 参数 以更改 -Dorg.jboss.logmanager.nocolor=true
参数到 false
.
In the Edit Configuration dialog, edit the VM arguments to change -Dorg.jboss.logmanager.nocolor=true
argument to false
.
在 Linux 上,您可以删除该参数,在 Windows 上,您必须将其显式设置为 false
.
On Linux you may remove the argument, on Windows you have to set it explicitly to false
.
申请 + 确定
关于颜色映射
默认颜色映射如下:
About the color mapping
The default color mapping is as follow:
- 错误:红色
- 警告:黄色
- 信息:清除
- 调试:绿色
给出语法 error:red,warn:yellow,info:clear,debug:green
.
默认颜色映射设置在org.jboss.logmanager.formatters.ColorMap
类.
The default color mapping is set in the org.jboss.logmanager.formatters.ColorMap
class.
在standalone.xml中你可以这样设置映射:
In standalone.xml you may set the mapping like this:
<formatter name="COLOR-PATTERN">
<pattern-formatter color-map="error:red,warn:yellow,info:clear,fine:white,finer:green,finest:green" pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
这篇关于如何为 Wildfly 的日志着色 - Eclipse 上的 Jboss Server 控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!