pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah. <mallah@trade-india.com>
To: Ferdinand Smit <ferdinand@telegraafnet.nl>
To: pgsql-admin@postgresql.org
Subject: Re: How to rotate postgres logfiles
Date: Mon, 27 May 2002 18:25:42 +0530
Message-ID: <200205271825.42610.mallah@trade-india.com> (raw)
In-Reply-To: <200205271350.20631.ferdinand@telegraafnet.nl>
References: <200205271350.20631.ferdinand@telegraafnet.nl>


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@bigfoot.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.





view thread (2+ messages)

Message-ID: <200205271825.42610.mallah@trade-india.com>
Permalink:  ../200205271825.42610.mallah@trade-india.com/
Also on:    postgresql.org/message-id/200205271825.42610.mallah@trade-india.com

 · 

reply

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: mallah@trade-india.com, ferdinand@telegraafnet.nl
  Subject: Re: How to rotate postgres logfiles
  In-Reply-To: <200205271825.42610.mallah@trade-india.com>
  References: <200205271350.20631.ferdinand@telegraafnet.nl> <200205271825.42610.mallah@trade-india.com>

* 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