Re: rotatelog / logrotate with PostgreSQL - Mailing list pgsql-general

From scott.marlowe
Subject Re: rotatelog / logrotate with PostgreSQL
Date
Msg-id Pine.LNX.4.33.0209250857400.22525-100000@css120.ihs.com
Whole thread Raw
In response to Re: rotatelog / logrotate with PostgreSQL  ("Gaetano Mendola" <mendola@bigfoot.com>)
Responses Re: rotatelog / logrotate with PostgreSQL
Re: rotatelog / logrotate with PostgreSQL
List 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@bcbsm.com> wrote in message
> news:73309C2FDD95D11192E60008C7B1D5BB04C73F9B@snt452.corp.bcbsm.com...
> > 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@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-general by date:

Previous
From: Ben Roberts
Date:
Subject: Re: problem with maintenance script and missing pg_clog files with pg 7.2.1
Next
From: Tom Lane
Date:
Subject: Re: problem with maintenance script and missing pg_clog files with pg 7.2.1