Coloured /var/log/messages at tty12

Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too.

CCZE colourized logs

TTY’s can be accessed by pressing Alt + Ctrl + F[1 – 12] simultaneously. In the following, you’ll get a decent, colourized log display of /var/log/messages when you press Alt + Ctrl + F12

First install ccze, most distributions have it in their repositories. CCZE is a robust and modular log colorizer with plugins for apm, exim, fetchmail, httpd, postfix, procmail, squid, syslog, ulogd, vsftpd, xferlog, and more. It brightens up the log view.

To quickly test it, try tail -f var/log/messages | ccze -A

The -A switch prevents ccze from starting itself in a curses window.

Create a file cclm in /usr/local/bin(you have to be root to be able to do so), with the following contents:

#!/bin/sh
file="/var/log/messages"
where="/dev/tty12"
tail -f $file | ccze -A >> $where

Add the following line to /etc/inittab
c12:123456:respawn:/sbin/agetty -n -l /usr/local/bin/cclm 38400 tty12 linux
That’s all that there is to be done, either reboot to get it working, or execute the following in a terminal with privileges:

/sbin/agetty -n -l /usr/local/bin/cclm 38400 tty12 linux

This can be used on any ttys’. The most obvious ones to use would be tty8 to tty12.

3 Replies to “Coloured /var/log/messages at tty12”

Comments are closed.