Re: Logging which local address was connected to in log_line_prefix
Greg Sabino Mullane <htamfids@gmail.com>
From: Greg Sabino Mullane <htamfids@gmail.com>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: david@pgmasters.net, Peter Eisentraut <peter@eisentraut.org>, Cary Huang <cary.huang@highgo.ca>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-02-27T13:54:56Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add local-address escape "%L" to log_line_prefix.
- 3516ea768c92 18.0 landed
On Mon, Nov 18, 2024 at 10:07 AM Jim Jones <jim.jones@uni-muenster.de> wrote: > 2024-11-18 16:00:42.720 CET [3135117] -> 192.168.178.27 STATEMENT: > ... > 2024-11-18 16:01:23.273 CET [3114980] -> [local] LOG: received SIGHUP, > ... 2024-11-18 16:01:46.769 CET [3114981] -> [local] LOG: checkpoint > Is it supposed to be like this? > Great question. I think "supposed to" is a bit of a stretch, but I presume it's the difference between a client connecting and using its connection information versus an already existing backend process, which is always going to be "local". Overall this makes sense, as that checkpoint example above is coming from the checkpointer background process at 3114981, not the backend process that happened to trigger it. And 3114981 has no way of knowing the details of the caller's connection. FWIW, the patch still applies cleanly to head as of 2/27/2025, so no rebase needed. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support