Feature Request: log_line_prefix %h Counterpart

From: Jawala <jawala(dot)birdi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Feature Request: log_line_prefix %h Counterpart
Date: 2024-01-26 04:34:43
Message-ID: CAB3UGqnTokB0PMQiX+=Z0zeAkJjUr8C=d+cNL=dTRdVyAFQexQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-01-26 08:23:54 Re:
Previous Message Tom Lane 2024-01-26 03:45:33 Re: permission denied on socket