Reopen logfile on SIGHUP

From: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Reopen logfile on SIGHUP
Date: 2018-02-27 14:41:38
Message-ID: 500a5371-ac19-ca7a-6be4-3eabd086104f@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Large percentage of postgres installations, for example PGDG packages
for Debian/Ubuntu,
assume by default that log management will be handled by extrernals
tools such as logrotate.

Unfortunately such tools have no way to tell postgres to reopen log file
after rotation
and forced to use copy-truncate strategy that leads to a loss of log
messages which is unacceptable.

Small patch in the attachment implements logfile reopeninig on SIGHUP.
It only affects the file accessed by logging collector, which name you
can check with pg_current_logfile().

I hope you will find this feature useful.

--
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
reopen_logfile_on_SIGHUP_v0.patch text/x-patch 993 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Claudio Freire 2018-02-27 15:06:04 Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently
Previous Message Patrick Krecker 2018-02-27 14:36:29 Re: TODO item for broken \s with libedit seems fixed