[NCLUG] /var/log/message to console...

Michael Dwyer mdwyer at sixthdimension.com
Tue Jun 12 09:45:45 MDT 2001


> I've got a window into which I "tail -f | logcolorise" the
> contents of /var/log/messages. This works until the log gets
> rotated, and then it silently fails. I can fix it with a
> more complicated solution that periodically reopens the
> file and cats that to logcolorise, but I'm wondering if
> someone else has already done the work. I see a lot of
> screenshots with message log screens, so presumably other
> people are working on this vexing problem.

When the log-rotator hits them, it closes the files, and 
hups the daemons.  They then open up fresh files with new
file descriptors (usually).  Tail is no longer tailing the 
right file descriptor.  What you might do is just add the 
tail -f | logcolorize >/dev/tty7 
line to the log-rotate scripts, so it always starts a
new one after a hup...  Look for the logrotate.d directory
in /etc, I think.

For a more /complicated/ solution, you can add a line in your
/etc/syslog.conf file that sends all logs, regardless, through
some pipe.  I'm not sure it would work, and there are surely
reasons /not/ to do it, but it would probably do exactly what
you really want it to do...








More information about the NCLUG mailing list