Feature Request: log_line_prefix %h Counterpart - Mailing list pgsql-general

From Jawala
Subject Feature Request: log_line_prefix %h Counterpart
Date
Msg-id CAB3UGqnTokB0PMQiX+=Z0zeAkJjUr8C=d+cNL=dTRdVyAFQexQ@mail.gmail.com
Whole thread Raw
List pgsql-general
Hello,

Looking for an escape sequence for log_line_prefix for the IP address that traffic was destined to, i.e., the *local* address of the TCP connection, natural counterpart to "remote IP address".

If PostgreSQL listens on all/multiple interfaces, useful to be able to log to which a connection was established, (even if admins should already be aware of server routing tables).

In my particular case though, traffic comes through (is sourced from) 127.0.0.1 - I can't control this.
However, I can connect to PostgreSQL on any destination IP in the 127.0.0.0/8 netblock.
It would help me distinguish traffic if I could log local/destination IP address.
This log info would be more trustworthy (in my case) than %a app name.


Apologies if it's already in v16 "20.8. Error Reporting and Logging" or other docs and I'm simply not seeing it.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: permission denied on socket
Next
From: Laurenz Albe
Date:
Subject: Re: