From: | Giles Lean <giles(at)nemeton(dot)com(dot)au> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: more contrib: log rotator |
Date: | 2003-04-06 21:48:24 |
Message-ID: | 3922.1049665704@nemeton.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Seems like a good bare-bones file writer; but how about all those
> frammishes that people ask for like generating date-based filenames,
> switching every so many bytes, etc? Also, it'd be nice not to be
> dependent on a cron job to tickle the switchover.
One of the earlier times this discussion came up I wrote a log
rotation program too. It will rotate based on time, file size,
and/or SIGHUP:
ftp://ftp.nemeton.com.au/pub/src/logwrite-1.0alpha.tar.gz
Written in C, BSD license, used on my production systems. Needs to be
updated to not have 'alpha' in the URL ... no bug reports in 18 months
means that it could at least be beta. ;-) It should be portable: I've
built it on *BSD, HP-UX, and Linux at least. I'd need help for
Windows.
I took pains to deal with some of the concerns Tom raised last time
about not giving up and exiting when a filesystem fills up. This is
something that the Apache rotatelogs program didn't do at the time I
looked at it, else I'd have not written this at all.
> I too would rather this functionality were integrated into the server,
> but I haven't noticed anyone stepping up to the plate to do it.
Shouldn't be hard: the server only has to create a pipe, and run the
log rotation program. For extra robustness re-starting the log
rotation program if it exits ("don't kill -9 the log rotator") is a
good idea.
I'll look at doing this, unless the discussion heads somewhere else
e.g., if Peter decides to integrate his code. The server changes are
probably independent of whichever log rotation program is preferred
anyway.
Regards,
Giles
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Sullivan | 2003-04-06 22:17:15 | Re: more contrib: log rotator |
Previous Message | Peter Eisentraut | 2003-04-06 21:03:27 | Re: more contrib: log rotator |