Re: Current log files when rotating?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: depesz(at)depesz(dot)com
Cc: Greg Smith <gsmith(at)gregsmith(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Current log files when rotating?
Date: 2008-11-10 19:58:01
Message-ID: 1226347081.21694.66.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 there is no
> guarantee that the last "accessed" file is the current one.
>
> on the other hand - there is also no such guarantee for current being
> "last after sorting", so there is a room for failure here anyway.
>
> the only way to do it without having problems with "strange" names or
> dates of access:
>
> ps uw -C postgres | grep logger | awk '{print "/proc/"$2"/fd"}' | xargs ls -l | grep /var/log/postgresql | awk '{print $NF}' | xargs tail -f
>
> but it has its own set of problems ranging from "being totally
> unreadable" to "requires running on postgres user or as root".

O.k. so I think this whole thread screams TODO...

A function that allows a postgresql user to know which log file is
currently being written to.

Joshua D. Drake

>
> Best regards,
>
> depesz
>
> --
> Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
> jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdel / skype:depesz_hdl / gg:6749007
>
--

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-10 20:00:47 Re: Current log files when rotating?
Previous Message hubert depesz lubaczewski 2008-11-10 19:55:11 Re: Current log files when rotating?