Обсуждение: pgsql: Emit a log message if output is about to be redirected away from

Поиск
Список
Период
Сортировка

pgsql: Emit a log message if output is about to be redirected away from

От
Tom Lane
Дата:
Emit a log message if output is about to be redirected away from stderr.

We've seen multiple cases of people looking at the postmaster's original
stderr output to try to diagnose problems, not realizing/remembering that
their logging configuration is set up to send log messages somewhere else.
This seems particularly likely to happen in prepackaged distributions,
since many packagers patch the code to change the factory-standard logging
configuration to something more in line with their platform conventions.

In hopes of reducing confusion, emit a LOG message about this at the point
in startup where we are about to switch log output away from the original
stderr, providing a pointer to where to look instead.  This message will
appear as the last thing in the original stderr output.  (We might later
also try to emit such link messages when logging parameters are changed
on-the-fly; but that case seems to be both noticeably harder to do nicely,
and much less frequently a problem in practice.)

Per discussion, back-patch to 9.3 but not further.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6d8186ff779fd46f0251eb252e7489fd38ab793b

Modified Files
--------------
src/backend/postmaster/postmaster.c |   10 ++++++++++
src/backend/postmaster/syslogger.c  |   16 ++++++++++++++--
src/backend/utils/error/elog.c      |    1 +
src/backend/utils/misc/guc.c        |    4 +---
src/include/utils/elog.h            |    1 +
5 files changed, 27 insertions(+), 5 deletions(-)