[Pkg-postgresql-public] Bug#876669: postgresql: cannot make standard postgresql clusters log to stderr or syslog

Christoph Berg myon at debian.org
Mon Sep 25 07:31:54 UTC 2017


Re: Daniel Kahn Gillmor 2017-09-24 <150621934369.835.11298534420205898532.reportbug at alice.fifthhorseman.net>
> So I'd like the cluster to log to stderr (or syslog), to have it not
> have to contemplate log rotation at all.  I've uncommented the
> following in /etc/postgresql/9.6/main/postgresql.conf:
> 
>     log_destination = 'stderr'
>     logging_collector = off
> 
> but this doesn't prevent the postgres process from re-opeing
> /var/log/postgresql/postgresql-9.6-main.log.  I've traced the startup
> code as far as pg_ctlcluster to where it looks like it's enforcing the
> logging to /var/log, but i can't figure out how to get it to stop.

The log file on disk is necessary in many configurations because only
elog() is redirected to the configured log destination, while things
that print directly to stderr (most frequent offender would be
errors from an archive_command) would otherwise get lost. Also, that
file logs errors that occur before the logging config has been
activated, like syntax errors in postgresql.conf.

I realize that setups that really just want to catch stderr to feed it
elsewhere have a problem here.

> And pg_ctlcluster seems to define the active logging to the filesystem
> as part of the "start" subcommand :/

Maybe we should add a switch to pg_ctl.conf, catch_stderr = on/off.

> How can i get it to not write to these logs?

Did you give 'syslog' a try, btw? It should mostly do what you want,
until there is a proper fix.

Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20170925/93ce6917/attachment.sig>


More information about the Pkg-postgresql-public mailing list