Re: Definitive logrotate solution? - Mailing list pgsql-admin

From Wells Oliver
Subject Re: Definitive logrotate solution?
Date
Msg-id CAOC+FBVC7xxsTWPEdy0zpDMzhvi+i-mzdw616MG+6uWhxv_YGQ@mail.gmail.com
Whole thread Raw
In response to Re: Definitive logrotate solution?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Definitive logrotate solution?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
How do you ensure you're not keeping logs from 35+ days ago, or whatever? Just a find -mtime +10 -exec rm {}\; kind of thing?

On Wed, Apr 11, 2012 at 4:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Wells Oliver <wellsoliver@gmail.com> writes:
> Might anyone share theirs? My log_rotation is set to 'stderr', and the log
> files are being put into /var/log/postgresql.

> My main concern is the postrotate action-- want to make sure the log is
> properly rotated, unneeded older logs removed, and postgres... properly
> bounced?

Use the logging collector with its built-in rotation parameters, and you
don't need anything else.

If you insist on an external solution, there's basically no way except
to shut down and restart postgres after any rotation, because there are
going to be N processes all connected to the same stderr file descriptor.

                       regards, tom lane



--
Wells Oliver
wellsoliver@gmail.com

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Definitive logrotate solution?
Next
From: Tom Lane
Date:
Subject: Re: Definitive logrotate solution?