Menu

Customizing

Paul Gover

How to customize logcolourer

logcolourer has a single configuration file, by default /etc/logcolourer.conf or /usr/local/etc/logcolourer.conf. Use a non-default configuration by specifying the file name as the parameter to logcolourer.

logcolourer my.conf <plain.log >coloured.log

The sample supplied is designed to work on terminals with a black background. You will need to change it to work with a white or coloured background, as some severities will have insufficient contrast to be visible. You will need to change it if you suffer from red-green or total colour vision deficiency

The file specifies the colours, intensities and attributes applied to lines processed by the logcolourer program.

  • Non-empty non-comment lines in this file list the colours, intensities and attributes applied to output from the logcolourer program, selected by the first character of each line input to the program.
  • The non-empty lines are applied in order, with the first line applied to input starting with a 0, the second line applied to input starting with a 1, up to a tenth line which would be applied to input starting with a 9.
  • Colours may be chosen from black, red, yellow, green, blue, magenta, cyan and white. Intensity may be bright or normal. bold is a synonym for bright. Attributes may be chosen from blink, reverse and underline. If you include more than one colour, intensity and/or attribute, all but the last ones are ignored.
Rendering Values
colour red yellow, green, blue, magenta, cyan and white
intensity normal and bright or bold
attribute blink, reverse and underline

The default colour is white, and the default attribute and intensity are normal.

The sample configuration is

bright blink white      # 0 - Emergency
yellow reverse          # 1 - Alert
bold red reverse        # 2 - Critical

bright red              # 3 - Error
bright yellow           # 4 - Warning
bright green            # 5 - Notice
bright blue             # 6 - Information
white                   # 7 - Debug

Related

Wiki: Home
Wiki: Installing