Allow cluster_name in log_line_prefix - Mailing list pgsql-hackers

From Craig Ringer
Subject Allow cluster_name in log_line_prefix
Date
Msg-id CAMsr+YE-Q5ftx9+6xxfrY6j_xXCL1QQ5DqBBtknyRoVOrNpiJg@mail.gmail.com
Whole thread Raw
Responses Re: Allow cluster_name in log_line_prefix  (Thomas Munro <thomas.munro@gmail.com>)
Re: Allow cluster_name in log_line_prefix  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Re: Allow cluster_name in log_line_prefix  (Fujii Masao <masao.fujii@gmail.com>)
Re: Allow cluster_name in log_line_prefix  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi folks

I was recently surprised to notice that log_line_prefix doesn't support a cluster_name placeholder. I suggest adding one. If I don't hear objections I'll send a patch.

Before anyone asks "but why?!":

* A constant (short) string in log_line_prefix is immensely useful when working with logs from multi-node systems. Whether that's physical streaming replication, logical replication, Citus, whatever, it doesn't matter. It's worth paying the small storage price for sanity when looking at logs. 

* Yes you can embed it directly into log_line_prefix. But then it gets copied by pg_basebackup or whatever you're using to clone standbys etc, so you can easily land up with multiple instances reporting the same name. This rather defeats the purpose.



--
 Craig Ringer                   http://www.2ndQuadrant.com/
 2ndQuadrant - PostgreSQL Solutions for the Enterprise

pgsql-hackers by date:

Previous
From: "Smith, Peter"
Date:
Subject: RE: Proposal: Add more compile-time asserts to exposeinconsistencies.
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Restore replication settings when modifying a field type