Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2401

Improve log coloring

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.2.0.M1
    • karaf
    • None

    Description

      Apache Karaf uses colors in the shell. For example red for ERROR lines in the logs, and so forth.

      The end user can change these colors in the configuration file, but this is not easy to do for the average end user.

      It would be great if Karaf offers

      • a command to show the current color settings (with example)
      • a command to change color

      Also down the road it would be great if we could have color themes. So people can easily switch to another scheme. For example a black/white. And also create their own color themes.

      The default colors is not ideal. For example Windows users has horrible experience as the red and blue colors is very hard to read on a standard windows DOS prompt.

      There is some way to change the colors in the DOS prompt but Windows people dont know about this. And frankly it would be nicer if Karaf offered a better out of the box experience.

      Some links about changing colors
      http://tmielke.blogspot.de/2013/04/how-to-chang-colors-in-karaf-shell.html

      Alternatively, you can edit the etc/org.apache.karaf.shell.log.cfg file and add the following properties

      fatalColor=39
      errorColor=39
      warnColor=39
      infoColor=39
      debugColor=39
      traceColor=39

      See http://en.wikipedia.org/wiki/ANSI_escape_code for standard colours.

      The string is prepended with 0x27 and '[' and suffixed by 'm to build a correct ansi code, so it should be possible to build more complicated colour strings for blinkings and such.
      For example the following setting
      infoColor=1m\0x2739
      will turn on bold with default colour for info statements.

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: