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?
Install the ANSI Escape in Console plugin from the Eclipse Marketplace : https://marketplace.eclipse.org/content/ansi-escape-console
You may have to set or change the -Dorg.jboss.logmanager.nocolor=true
VM argument from Wildfly server launch configuration.
To change it you:
Go to the "Servers" tab
Right click on the Wildlfy server
Select Open
menu entry
In the displayed Overview tab, section General information, click on Open launch configuration
In the Edit Configuration dialog, edit the VM arguments to change -Dorg.jboss.logmanager.nocolor=true
argument to false
.
On Linux you may remove the argument, on Windows you have to set it explicitly to false
.
Apply + OK
The default color mapping is as follow:
Which gives the syntax error:red,warn:yellow,info:clear,debug:green
.
The default color mapping is set in the org.jboss.logmanager.formatters.ColorMap
class.
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>