logcheck compatible daily logfile rotation?

From: Christian Hammers <chammers(at)netcologne(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: logcheck compatible daily logfile rotation?
Date: 2012-12-10 13:05:17
Message-ID: 20121210140517.6e6cd431@sys-251.netcologne.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I'm trying to figure out how to configure a logcheck compatible logfile
rotation i.e. where
a) the current logfile always has a fixed name and old files are named like
"*.1", "*.2.gz" etc. and
b) the current logfile is not truncated but newly created (or else logcheck
always warns about possible tempering)

So essentially I want syslog style logrotation but not using syslog as that
was not recommended ("not very reliable" in chapter 23.3) and does not look
so nice (hostname in every line due to syslog output format, #011 instead of
tabs in multiline messages).

The builtin log catcher does not rotate files if no "%Y" or similar is in
log_filename and neither can be told to reopen the file with SIGHUP or
"pg_ctl reload".

Using "pg_ctl start | rotatelogs", which is recommended in the docs would
imply that I modify the /etc/init.d/ script which would work but I hate
editing Debian package scritps because such modifications are too easily
broken on updates.

At the moment I'm stuck with syslog and a custom rsyslog template but still,
I'm curious what others are doing!

bye,

-christian-

Browse pgsql-general by date

  From Date Subject
Next Message Eelke Klein 2012-12-10 13:26:17 Out of memory error
Previous Message Vik Reykja 2012-12-10 09:23:57 Re: proposal: fix corner use case of variadic fuctions usage