Proposal: leave a hint when switching logging away from stderr

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Proposal: leave a hint when switching logging away from stderr
Date: 2013-08-09 02:32:17
Message-ID: 11372.1376015537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch is motivated by
http://www.postgresql.org/message-id/CAJYQwwRYt9RMBzs-sH6uCr1OTG4joXqkDF-fkoYP6pv12t0dsQ@mail.gmail.com
in which it appears that Oliver Elphick forgot to look in the configured
log_directory directory for log output, and instead examined only the file
that postmaster stderr was initially being sent to. He's far from the
first to make such a mistake, and if a PG hacker of his standing can
forget about this, I think we've got a usability issue we ought to do
something about.

This patch arranges to emit a hint message when/if we switch away from
logging to the original postmaster stderr during startup. There are two
cases to cover: we're still using LOG_DESTINATION_STDERR but redirecting
stderr to a syslogger process, or we stop writing to stderr altogether,
presumably in favor of going to syslog or something.

I thought about trying to leave similar breadcrumbs if the logging
parameters are changed while the postmaster is running, but it would add a
fair amount of complication to the patch, and I'm not sure there's a lot
of value in it. On-the-fly logging parameter changes don't happen without
active DBA involvement, so it's a lot harder to credit that somebody would
not be expecting the data to start going somewhere else.

Thoughts? In particular, anyone want to bikeshed on the message wording?

Does this rise to the level of a usability bug that ought to be
back-patched? As I said, we've seen this type of thinko multiple
times before.

regards, tom lane

Attachment Content-Type Size
log-destination-breadcrumbs-1.patch text/x-diff 3.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-08-09 02:57:03 Re: Proposal for XML Schema Validation
Previous Message Andres Freund 2013-08-09 02:27:31 Re: 9.4 regression