how to color the log of Wildfly - Jboss Server console on Eclipse

后端 未结 2 511
[愿得一人]
[愿得一人] 2020-12-19 21:46

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 tomca

相关标签:
2条回答
  • 2020-12-19 22:20

    Coloring the Wildfly log in the Eclipse console :

    1. Install the ANSI Escape in Console plugin from the Eclipse Marketplace : https://marketplace.eclipse.org/content/ansi-escape-console

    2. You may have to remove the -Dorg.jboss.logmanager.nocolor=true VM argument from Wildfly server launch configuration. To remove it you:

      1. Go to the "Servers" tab
      2. Right click on the Wildlfy server
      3. Select Open menu entry
      4. In the displayed Overview tab, section General information, click on Open launch configuration
      5. In the Edit Configuration dialog, edit the VM arguments to remove -Dorg.jboss.logmanager.nocolor=true argument.
      6. Apply + OK

    About the color mapping :

    The default color mapping is as follow:

    • error : darkred
    • warn : yellow
    • info : clear
    • debug : green

    Which gives the syntax error:darkred,warn:yellow,info:clear,debug:green .

    The default color mapping is set in the org.jboss.logmanager.formatters.ColorMap class.

    0 讨论(0)
  • 2020-12-19 22:21

    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

    0 讨论(0)
提交回复
热议问题