Re: more contrib: log rotator - Mailing list pgsql-hackers

From scott.marlowe
Subject Re: more contrib: log rotator
Date
Msg-id Pine.LNX.4.33.0304041002480.22611-100000@css120.ihs.com
Whole thread Raw
In response to Re: more contrib: log rotator  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-hackers
On Fri, 4 Apr 2003, Andrew Sullivan wrote:

> On Fri, Apr 04, 2003 at 09:16:39AM -0700, scott.marlowe wrote:
> > where -r is the rotation period in seconds.  If it's an external program 
> 
> Ours rotates based on size rather than time.  I can see some
> advantages to the time-based approach, but if you have wide
> variations in traffic, you run the risk of rotating over useful files
> with more or less empty ones if you use it.

I would want time based for sure, and I can see the use for size based 
splitting as well.  I wouldn't be hard to have it do both would it?

I just like the idea of it being one of the dozens or so options for 
pg_ctl so it's painless to use for joe six pack.

pg_ctl -r 86400 -l $PGDATA/logs/pgsql

where -r is the rotation period

OR

pg_ctl -f 10M -l $PGDATA/logs/pgsql

where -f is the max file size of a log

I'd recommend that the nameing convnention should probably 
be:

filenamespec.timestamp, like:  $PGDATA/logs/pgsql.1049414400

for time rotated logs, and 

filename.incnumber like:  $PGDATa/logs/pgsql.0000000001



pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: more contrib: log rotator
Next
From: Tom Lane
Date:
Subject: Re: more contrib: log rotator