Re: Daniel Kahn Gillmor 2017-09-24 
<150621934369.835.11298534420205898532.report...@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

Attachment: signature.asc
Description: PGP signature

Reply via email to