Re: [GENERAL] Current log files when rotating?

2014-12-10 Thread Alex Shulgin
Sam Mason s...@samason.me.uk writes: 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 alvhe...@commandprompt.com writes: It seems that there is enough need for this feature, that it has been implemented multiple times

Re: [GENERAL] Current log files when rotating?

2008-11-11 Thread Sam Mason
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 [EMAIL PROTECTED] 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.

Re: [GENERAL] Current log files when rotating?

2008-11-11 Thread Andrus
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

[GENERAL] Current log files when rotating?

2008-11-10 Thread Greg Smith
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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Tom Lane
Greg Smith [EMAIL PROTECTED] writes: 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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread brian
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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Joshua D. Drake
On Mon, 2008-11-10 at 13:46 -0500, 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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Joshua D. Drake
On Mon, 2008-11-10 at 13:46 -0500, 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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread hubert depesz lubaczewski
On Mon, Nov 10, 2008 at 01:46:14PM -0500, Greg Smith wrote: 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's not nice, but it works: alias pgtail='/bin/ls -1

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Asko Oja
$ cat dbscripts/logtail.py #!/usr/bin/env python usage: logtail [-d pathname][-n] -d pathname Use pathname instead of /var/lib/postgresql/8.2/main/pg_log -nJust print the current log file name and exit -lList the log file names -p [files]Run the files

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Joshua D. Drake
On Mon, 2008-11-10 at 20:12 +0100, hubert depesz lubaczewski wrote: On Mon, Nov 10, 2008 at 01:46:14PM -0500, Greg Smith wrote: 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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Scott Marlowe
On Mon, Nov 10, 2008 at 12:44 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: On Mon, 2008-11-10 at 20:12 +0100, hubert depesz lubaczewski wrote: On Mon, Nov 10, 2008 at 01:46:14PM -0500, Greg Smith wrote: strftime would both work I guess, those just seemed a little heavy (was hoping for an

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread hubert depesz lubaczewski
On Mon, Nov 10, 2008 at 11:44:31AM -0800, Joshua D. Drake wrote: Hmm what about just ls -tu Which if I am reading the man page correctly sorts by last access time. which might not be what you need. the problem is that there is no guarantee that the last accessed file is the current one. on the

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Joshua D. Drake
On Mon, 2008-11-10 at 20:55 +0100, hubert depesz lubaczewski wrote: On Mon, Nov 10, 2008 at 11:44:31AM -0800, Joshua D. Drake wrote: Hmm what about just ls -tu Which if I am reading the man page correctly sorts by last access time. which might not be what you need. the problem is that

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Alvaro Herrera
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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Greg Smith
On Mon, 10 Nov 2008, Joshua D. Drake wrote: O.k. so I think this whole thread screams TODO... Me too; added to the TODO list on the wiki. I presumed there had to be a simple way to handle this as the need for it seemed pretty obvious. All of the sample scripts and shell tricks are

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] 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

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Joshua D. Drake
On Mon, 2008-11-10 at 16:35 -0500, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] 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 ...

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Steve Atkins
On Nov 10, 2008, at 1:35 PM, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] 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 ... ...

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Greg Smith
On Mon, 10 Nov 2008, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] 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