Re: more contrib: log rotator

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: more contrib: log rotator
Date: 2003-04-04 17:04:25
Message-ID: 200304041004.25267.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday April 4 2003 9:16, scott.marlowe wrote:
>
> That said, a log rotation capability built right into pg_ctl or
> thereabouts would be a very nice feature. I.e. 'pg_ctl -r 86400 -l
> $PGDATA/logs/pgsql start'
>
> where -r is the rotation period in seconds. If it's an external program
> that pg_ctl calls that's fine, and it could even just be a carbon copy of
> apache's log rotater if their license is compatible (isn't it?)

By way of feature ideas, one very convenient but not widely used feature of
Apache's log rotator is the ability to specify a strftime() format string
for the file extension. For example, if I want to have my logs rollover
every 24 hours and be named log.Mon, log.Tue, log.Wed, I say something like

pg_ctl start | rotatelogs 86400 "%a"

This causes the logs to overwrite themselves every seven days, taking log
maintenance time to very near zero. We also customized our use of it to
allow us to automatically move existing logs out of the way to "log.1",
"log.2", or to simply overwrite existing logs.

Ed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ed L. 2003-04-04 17:06:42 Re: more contrib: log rotator
Previous Message Ed L. 2003-04-04 16:52:13 <sequence_name>.sequence_name != <sequence_name>?