Re: Current log files when rotating?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Current log files when rotating?
Дата
Msg-id 20081111115411.GF2459@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: Current log files when rotating?  (Steve Atkins <steve@blighty.com>)
Ответы Re: Current log files when rotating?  (Alex Shulgin <ash@commandprompt.com>)
Список pgsql-general
On Mon, Nov 10, 2008 at 02:30:41PM -0800, Steve Atkins wrote:
> On Nov 10, 2008, at 1:35 PM, Tom Lane wrote:
> >Alvaro Herrera <alvherre@commandprompt.com> writes:
> >>It seems that there is enough need for this feature, that it has been
> >>implemented multiple times -- but most of them will fail in corner
> >>cases.  Seems an obvious candidate for an in-core function ...
> >
> >... which will still fail in corner cases.  Not to mention the race
> >condition when the logger has just/is about to switch.
>
> Also, it's going to be a fairly rare app that will need to both
> look at the current logfile and access the database, so providing
> visibility via a sql function seem clunky.

Indeed, logfiles seem to be in a different world than from inside the
database.  It seems there are a couple of options; go and ask PG when
you want to know (pg_ctl seems like a reasonable place IMHO) or have
PG tell you when it's rotating logs, ala the current archiving of WAL
files.

> Maybe just have the logger maintain a symlink to the current
> logfile,

If used; a log archival program could do this.

> or log to a static filename and only use a dynamically
> generated filename when renaming the log file during rotation?

However, this seems like a simpler solution altogether---no need to even
ask as you know the answer already!

This does still leave the question of whether there should be a log
archival program around to tell you when they actually rotate.  Going
by the fact that people appear to cope with the current behavior, this
just seems unnecessarily complicated and can reasonably be delayed for a
while.


  Sam

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

Предыдущее
От: Joao Ferreira gmail
Дата:
Сообщение: Re: merge 2 dumps
Следующее
От: "Sergey Konoplev"
Дата:
Сообщение: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)