问题
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?
回答1:
You can define a color map to assign a color to different log levels.
The format is a comma-separated list of LEVEL:COLOR
.
- Valid levels: finest, finer, fine, config, trace, debug, info, warning, warn, error, fatal, severe
- Valid colors: black, green, red, yellow, blue, magenta, cyan, white, brightblack, brightred, brightgreen, brightblue, brightyellow, brightmagenta, brightcyan, brightwhite
Launch the jboss cli cmd
- on Linux jboss-cli.sh
- on windows jboss-cli.bat
location : C:\FileLocation\wildfly-17.0.0.Final\wildfly-17.0.0.Final\bin
then enter this cmd :
logging/pattern-formatter=PATTERN_FORMATTER_NAME:write-attribute(name=color-map,value="LEVEL:COLOR,LEVEL:COLOR")
source
来源:https://stackoverflow.com/questions/59006162/how-to-color-the-log-of-wildfly-jboss-server-console-on-eclipse