[syslog-ng]log rotation features for syslog-ng

klaas.vangend@philips.com klaas.vangend@philips.com
Thu, 24 Jan 2002 10:03:59 +0100


Gentlemen,

I'd like enhance syslog-ng with some features in order to get rid of some 
log rotation scripts.

For some of our systems, we log on a centralised system, but also store 
the logs locally.
These logs only need limited availability, say a week or so.
The file() destination currently is already able to use the target 
$WEEKDAYS (which is undocumented, btw),
but in that case, logs from both Jan 17 and Jan 24 are logged in 
messages.Thu.log
Therefore, I'd like to add a new option   clear_old(X) which removes a 
logfile with a timestamp older than X days prior to writing the new 
message to that file.
(default should be 0 (=never), which means that for a disabled feauture 
only one C 'if' statement additional overhead is caused)

But I can imagine that people also wants to set a max size on a logfile.
E.g. to be able to compress it afterwards, or for simple log rotation,
like:

file('/var/log/mesages' max_size_old(200, 'gzip'))
will rename the existing 200 kB file to /var/log/messages.old 
and then run 'gzip /var/log/messages.old'

Maybe it is better to add a new destination rotatedfile(),
maybe it's better to do something else...

I'd to know wheter everyone agrees that these features are a good idea, 
and that the proper approach is taken to
keep the configurationfile syntax simple.




Groetjes,

Klaas van Gend