Thread: Feature Request: log_line_prefix %h Counterpart

Feature Request: log_line_prefix %h Counterpart

From
Jawala
Date:
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.

Re: Feature Request: log_line_prefix %h Counterpart

From
Greg Sabino Mullane
Date:
Actually, will just post it here in case someone finds this thread and wants to follow along: