Re: serverlog function (log_destination file) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: serverlog function (log_destination file)
Date
Msg-id 3049.1086618702@sss.pgh.pa.us
Whole thread Raw
In response to Re: serverlog function (log_destination file)  ("Dave Page" <dpage@vale-housing.co.uk>)
Responses Re: serverlog function (log_destination file)  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgsql-hackers
"Dave Page" <dpage@vale-housing.co.uk> writes:
> ... what about adding a GUC variable that can be used to specify an
> amount of shared memory to use as a fifo area in which a copy of the log
> output is stored for return to clients that might want it (accessing it
> via internal functions)?

No, that's a nonstarter, because having the postmaster log into shared
memory means that the postmaster probably goes down too anytime a
backend crashes.  The shared area would have to have a mutual-exclusion
lock, and we definitely do not want the postmaster participating in any
lock protocols.

If I were trying to solve Andreas' problem, I'd pipe stderr to some
program that stores recent log output in a file that I know the location
of and can read from the hypothetical log-grabber function.  Actually I
don't see that there's any need to involve Postgres itself in this issue
at all --- seems like the only agreement needed is between the GUI and
the postmaster launching script about where the log file is.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: serverlog function
Next
From: "Dave Page"
Date:
Subject: Re: serverlog function (log_destination file)