Tom Lane wrote:
> Fernando Nasser <fnasser@redhat.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