Skip site navigation (1) Skip section navigation (2)

Current log files when rotating?

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Current log files when rotating?
Date: 2008-11-10 18:46:14
Message-ID: Pine.GSO.4.64.0811101325260.9276@westnet.com (view raw or flat)
Thread:
Lists: pgsql-general
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.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

Responses

pgsql-general by date

Next:From: brianDate: 2008-11-10 18:58:02
Subject: Re: Current log files when rotating?
Previous:From: Scott MarloweDate: 2008-11-10 18:03:46
Subject: Re: Upgrading Postgres question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group