Re: more contrib: log rotator

Поиск
Список
Период
Сортировка
От Ed L.
Тема Re: more contrib: log rotator
Дата
Msg-id 200304041004.25267.pgsql@bluepolka.net
обсуждение исходный текст
Ответ на Re: more contrib: log rotator  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: more contrib: log rotator
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Ed L."
Дата:
Сообщение: .sequence_name != ?
Следующее
От: "Ed L."
Дата:
Сообщение: Re: more contrib: log rotator