Re: Logging which local address was connected to in log_line_prefix

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, david(at)pgmasters(dot)net, Peter Eisentraut <peter(at)eisentraut(dot)org>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logging which local address was connected to in log_line_prefix
Date: 2025-04-06 22:41:18
Message-ID: Z_MDDsSmk5b-6jD4@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 06, 2025 at 06:01:01PM -0400, Tom Lane wrote:
> I don't really care for #3 or #4, but I'm ambivalent between #1 and
> #2. I think the worry about confusion originated when the patch
> would print "[local]" for either a Unix socket or a background
> process, and that certainly was confusing. "[local]" versus
> an empty string is not so ambiguous, so maybe it's fine.

I'd suggest the addition of this data to csvlog.c and jsonlog.c,
perhaps only adding this information if local_host[0] is not '\0'
rather than assigning a default "[none]" all the time to save some
space in the entries generated.

config.sgml would also need a refresh:
- runtime-config-logging-jsonlog-keys-values for the new key/value
pair.
- runtime-config-logging-csvlog for the CREATE TABLE and the list of
columns.

Perhaps it would be time to switch the list of columns to use a proper
table instead of a raw list for the CSV docs, for clarity.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-04-06 22:50:54 Re: History doc page clarification on naming
Previous Message Tom Lane 2025-04-06 22:01:01 Re: Logging which local address was connected to in log_line_prefix