Re: Current log files when rotating?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Current log files when rotating?
Date: 2008-11-10 20:00:47
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Greg Smith wrote:
> Let's say you're using logging_collector and you've put some %-escapes
> into log_filename for daily log rotation. Perhaps it's daily rotation
> with this pattern:
> log_filename = 'postgresql-%Y-%m-%d.log'
> Is there any good way to ask the server what log file name it's currently
> writing to? I was trying to write something that does a "tail" on the
> current log, and was hoping there was a simple way to figure out which
> file that goes against. Looking for the latest timestamp or running
> strftime would both work I guess, those just seemed a little heavy (was
> hoping for an "alias"-sized answer) to figure out something that the
> server certainly knows.

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 ...

Alvaro Herrera
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to


Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-11-10 21:27:35 Re: Current log files when rotating?
Previous Message Joshua D. Drake 2008-11-10 19:58:01 Re: Current log files when rotating?