Re: Logging which local address was connected to in log_line_prefix - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Logging which local address was connected to in log_line_prefix
Date
Msg-id Z_MDDsSmk5b-6jD4@paquier.xyz
Whole thread Raw
In response to Re: Logging which local address was connected to in log_line_prefix  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Logging which local address was connected to in log_line_prefix
List 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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Logging which local address was connected to in log_line_prefix
Next
From: Daniel Gustafsson
Date:
Subject: Re: History doc page clarification on naming