Re: How to rotate postgres logfiles

From: "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com>
To: Ferdinand Smit <ferdinand(at)telegraafnet(dot)nl>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How to rotate postgres logfiles
Date: 2002-05-27 12:55:42
Message-ID: 200205271825.42610.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Hi ,

This question has been asked before in the list
by me.

and below is an workable solution provided by Gaetano

regds
mallah.

---------------------------------------------
Well,
the most correct way to do a logrotate is ( Redhat ):

1) Put on your postgresql.conf the following lines:

syslog = 2
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

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(at)bigfoot(dot)com
create 0664 postgres postgres
daily
postrotate
/usr/bin/killall -HUP syslogd
endscript
}

change the email address of course :-)

3) Put the following line on your /etc/syslog.conf

# Save postgresql logs
LOCAL0.*
/var/log/postgresql.log

Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");

On Monday 27 May 2002 05:20 pm, Ferdinand Smit wrote:
> Hi,
>
> Does anyone know how to flush the logfiles op postgres. I need it for
> logrotate.
> '/usr/lib/postgresql/bin/pg_ctl reload' does not work, it does not create a
> new logfile.
>
> Regards,
> Ferdinand
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ravi K.R. 2002-05-27 13:33:24 jdbc compile does not work
Previous Message Ferdinand Smit 2002-05-27 11:50:20 How to rotate postgres logfiles