From: Oliver Elphick <olly@lfix.co.uk>
To: Rajesh Kumar Mallah. <mallah@trade-india.com>
Cc: Mintoo Lall <tlqmail@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Postgres server output log
Date: 30 Jan 2003 12:40:10 +0000
Message-ID: <1043930409.1112.203.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <200301301052.36984.mallah@trade-india.com>
References: <20030130045105.28846.qmail@web14806.mail.yahoo.com>
<200301301052.36984.mallah@trade-india.com>
On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote:
>
> This is someones' elses' posting that i have preserved
> shud be useful.
...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
>
> Well,
> the most correct way to do a logrotate is ( Redhat ):
...
> 2) Put on the directory /etc/logrotate.d a file called
> 'postgres' with the following lines:
>
> /var/log/postgresql.log {
> compress
> rotate 2
> size=10000k
> errors mendola@bigfoot.com
> create 0664 postgres postgres
> daily
> postrotate
> /usr/bin/killall -HUP syslogd
> endscript
> }
...
This won't work as it stands with PostgreSQL, because the hangup signal
does not make the postmaster reopen the log file. Instead of that
postrotate section, you need to use logrotate's copytruncate option,
which will copy the logfile to another file before zeroing the logfile.
Depending on what is being logged, you may want to change the
permissions to 660; there may be stuff in the logs that you don't want
to reveal to the world. (With copytruncate, I think the create option
applies to the copy files rather than to the original logfile.)
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The Lord knoweth how to deliver the godly out of
temptations, and to reserve the unjust unto the day of
judgment to be punished;" II Peter 2:9
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: olly@lfix.co.uk, mallah@trade-india.com, tlqmail@yahoo.com
Subject: Re: Postgres server output log
In-Reply-To: <1043930409.1112.203.camel@linda.lfix.co.uk>
References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox