Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TF7nU-0007ON-PU for pgsql-bugs@postgresql.org; Fri, 21 Sep 2012 18:17:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TF7nT-0005f8-RT for pgsql-bugs@postgresql.org; Fri, 21 Sep 2012 18:17:52 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8LIHk48027990; Fri, 21 Sep 2012 14:17:46 -0400 (EDT) From: Tom Lane To: Peter Eisentraut cc: Reinhard Max , Heikki Linnakangas , pgsql-bugs@postgresql.org Subject: Re: BUG #7559: syslogger doesn't close stdout and stderr In-reply-to: <505CA84B.4090808@gmx.net> References: <29557.1348072752@sss.pgh.pa.us> <505AC648.7050400@vmware.com> <17544.1348153582@sss.pgh.pa.us> <505CA84B.4090808@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Fri, 21 Sep 2012 13:47:55 -0400" Date: Fri, 21 Sep 2012 14:17:46 -0400 Message-ID: <27988.1348251466@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/249 X-Sequence-Number: 34243 Peter Eisentraut writes: > On 9/20/12 11:06 AM, Tom Lane wrote: >> Well, I would have no objection to changing pg_ctl so that it redirects >> the postmaster's stdout/stderr when a -l switch is given (actually, >> I thought it did that already...). I do object to changing the logger's >> behavior as you suggest, because that will break use-cases that work >> today. One that I've used personally is adding "fprintf(stderr)" calls >> in the logger for debugging the logger itself. > The weird thing is, when the logger process dies and is restarted by the > postmaster, then both stdout and stderr point to /dev/null. So the > behavior is inconsistent either way. Yeah, that's annoying but there's no very good way to work around it. Fortunately, the logger doesn't die very often. All of the use-cases I've thought of for wanting to capture stderr output for it amount to debugging of some form or other, so it's probably good enough for that to only work in the first logger incarnation after database start --- but Reinhard is proposing to make it not work at all, and that I don't like. regards, tom lane