Re: rotatelog / logrotate with PostgreSQL

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: rotatelog / logrotate with PostgreSQL
Date: 2002-09-25 14:58:22
Message-ID: Pine.LNX.4.33.0209250857400.22525-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Well, I've found the syslog facility to be noticeable slower than
rotatelogs with pgsql doing its own logging. So that's why I do it the
rotatelogs way. Choice is good.

On Wed, 25 Sep 2002, Gaetano Mendola wrote:

> ""Johnson, Shaunn"" <SJohnson6(at)bcbsm(dot)com> wrote in message
> news:73309C2FDD95D11192E60008C7B1D5BB04C73F9B(at)snt452(dot)corp(dot)bcbsm(dot)com(dot)(dot)(dot)
> > This message is in MIME format. Since your mail reader does not understand
> > this format, some or all of this message may not be legible.
> >
> > ------_=_NextPart_001_01C26310.AA038860
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> >
> > Howdy:
> >
> > Running PostgreSQL 7.2.1 on RedHat Linux 7.2 kernel 2.4.7.
> >
> > Can someone send an example of how they have the
> > logrotate / rotatelog script working with PostgreSQL?
> > I'm looking at a few things and I can't seem to
> > get it to work.
>
> Hi, I seen a lot of reply, but I don't understand why all
> of us should crambling on the mirror for resolve a tipical
> problem already well solved on Linux box?
>
> Anyway how alread I suggested times ago the following
> way ( why don't put this in the documentation or in
> the FAQ ? ):
>
>
> Insert in your postgresql.conf the following lines:
>
> # File postgresql.conf
> syslog = 2
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'
>
> Create a file postgres under your /etc/logrotate/postgres
> ( the path depend on your installation )
>
> #File postgres
> /var/log/postgresql.log {
> compress
> rotate 2
> size=10000k
> create 0664 postgres postgres
> daily
> postrotate
> /usr/bin/killall -HUP syslogd
> endscript
> }
>
> Take a look at the option that you need.
>
> in the syslog.conf add the following lines:
>
> # Save postgresql logs
> LOCAL0.* /var/log/postgresql.log
>
>
> be sure that the file /var/log/postgresql.log is owned by
> postgres.
>
>
> Send a SIGHUP to postmaster and syslog after that setting.
> For test if the logrotate is working well force a rotation:
>
>
> $> logrotate -f /etc/logrotate/postgres
>
>
> Ciao
> Gaetano
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Tkach 2002-09-25 15:14:36 Prepared statement performance...
Previous Message Unixprgrmr 2002-09-25 14:56:12 Fwd: how do I detect when I have reached the last record of the table in ecpg?