Re: Log rotation

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Log rotation
Date: 2004-03-12 14:24:28
Message-ID: 4051C81C.80909@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Fernando Nasser <fnasser(at)redhat(dot)com> writes:
>
>>Please remind me again why the postmaster cannot close and open the log
>>file when it receives a SIGHUP (to re-read configuration)?
>
>
> (a) Because it never opened it in the first place --- the log file is
> whatever was passed as stderr.
>
> (b) Because it would not be sufficient to make the postmaster itself
> close and reopen the file; every child process would have to do so also.
> Doing this in any sort of synchronized fashion seems impossible.
>

Now I remember. Thanks for reminding me of that.

> It's much cleaner to have stderr be a pipe to some separate collector
> program that can handle log rotation (ie, the Apache solution).
>

We could also create a pipe and start a new process ("logger") and give
it the other end of the pipe and the name of the log file. We could
send it a SIGHUP after we reread the configuration file.

But just doing a pipe on the OS level is way simpler.

I don't really care on how its done, but IMO an enterprise class
database must be able to do log rotation. Logging to Syslog is not an
option (specially with our verbosity) -- users must be able to use flat
files for logging.

I never seem some many customer complaints and bug reports about a
single item like the ones we have received here about logging. I think
this should be the number 1 item in te TODO list.

Thanks again for the clarifications.

Regards,
Fernando

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-12 14:38:23 Re: client side syntax error localisation for psql (v1)
Previous Message Andreas Pflug 2004-03-12 13:56:40 Re: The Name Game: postgresql.net vs. pgfoundry.org