[syslog-ng]Thinking about linking
Jay Goldberg
jg@open.ch
Tue, 25 Jun 2002 17:06:22 +0200
Hi, syslog-ng'ers
A quick question for all - I've been using syslog-ng, but instead of using
the excellent built-in $YEAR $MONTH and $DAY macros for automatic logfile
rotation, I've been using a different solution -
I use the cronolog program (www.cronolog.org) as a destination for any files
that I want to keep locally. It's not optimal, but it allows me to do one
thing that keeps our complex management environment intact after the cutover
from syslog to syslog-ng, and that's to maintain a symbolic link to the
latest and previous logfiles in the place where folks/scripts would normally
think to look for them. So for example:
/reallybigdisk/logs/2002/06/messages.25 and
/reallybigdisk/logs/2002/06/messages.24
would be today's and yesterdays 'messages' file. But with cronolog, I'm able
to specify options so that /var/adm/messages is just a symlink to whatever file
we're logging to now, and /var/adm/messages.0 is a symlink to whatever file
we logged to last:
host# ls -l /var/adm/messages*
lrwxrwxrwx 1 root root 34 Jun 25 01:16 /var/adm/messages -> /reallybigdisk/logs/2002/06/messages.25
lrwxrwxrwx 1 root root 34 Jun 24 01:16 /var/adm/messages.0 -> /reallybigdisk/logs/2002/06/messages.24
I'm not sure if I missed this in the documentation for syslog-ng or perhaps
I'm just insane for thinking that this is useful :)
So I guess my questions after all this are:
- did I miss this in the documentation?
- am I insane for wanting such a feature?
- would it be a lot of trouble to add this feature?
...I was thinking something along the lines of a 'maintain_symlink' option for
a file destination that takes the target of the symlink (e.g., /var/adm/messages)
as an option.
I thought I'd ask first in case anyone's working on this already - it would save
me from hacking at and most likely desecrating the code. I've had a look through,
and it's a far tidier job than anything I've done in a long time. But then I haven't
been a C programmer for the last 9 years :(
Thanks!
Jay
--
jay goldberg
senior engineer
open systems ag
raeffelstrasse 29
ch-8045 zurich
t: +41 1 455 74 00
f: +41 1 455 74 01
jg@open.ch
http://www.open.ch