[syslog-ng] colored messages

Gaydov Victor gavv at lvk.cs.msu.su
Mon Nov 30 22:15:32 CET 2009


Hello.

I wrote a small patch to add colorization to syslog-ng. The idea is to
apply different color schemes to messages (that are going to a tty, for
example) depending on their type and importance and using standard
syslog-ng filters. IMHO this makes tty log much more readable.

There is a new keyword: 'scheme'. "scheme { ... }" construction binds
colors to message fields and "scheme()" field of "log {...}" adds scheme
filter that colorizes the output (before it will be sent to
destination).

The filter uses ANSI escape sequences but it's easy to extend it to
anything else. Color support is enabled with defining 'ENABLE_COLOR' or
using '--enable-colors' in configure script.

If you'll find it useful you can use it :) The patch and example (draft)
syslog-ng.conf are attached.

--
Gaydov Victor.

Practically perfect people never permit sentiment to muddle their thinking.
		-- Mary Poppins
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colors.patch
Type: text/x-patch
Size: 18680 bytes
Desc: not available
Url : http://lists.balabit.hu/pipermail/syslog-ng/attachments/20091201/941048cc/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syslog-ng.conf
Type: application/x-fluid
Size: 1858 bytes
Desc: not available
Url : http://lists.balabit.hu/pipermail/syslog-ng/attachments/20091201/941048cc/attachment-0001.bin 


More information about the syslog-ng mailing list