Re: Current log files when rotating? - Mailing list pgsql-general

From Sam Mason
Subject Re: Current log files when rotating?
Date
Msg-id 20081111115411.GF2459@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Current log files when rotating?  (Steve Atkins <steve@blighty.com>)
Responses Re: Current log files when rotating?  (Alex Shulgin <ash@commandprompt.com>)
List 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 by date:

Previous
From: Joao Ferreira gmail
Date:
Subject: Re: merge 2 dumps
Next
From: "Sergey Konoplev"
Date:
Subject: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)