Add local-address escape "%L" to log_line_prefix.
Tom Lane <tgl@sss.pgh.pa.us>
Add local-address escape "%L" to log_line_prefix. This escape shows the numeric server IP address that the client has connected to. Unix-socket connections will show "[local]". Non-client processes (e.g. background processes) will show "[none]". We expect that this option will be of interest to only a fairly small number of users. Therefore the implementation is optimized for the case where it's not used (that is, we don't do the string conversion until we have to), and we've not added the field to csvlog or jsonlog formats. Author: Greg Sabino Mullane <htamfids@gmail.com> Reviewed-by: Cary Huang <cary.huang@highgo.ca> Reviewed-by: David Steele <david@pgmasters.net> Reviewed-by: Jim Jones <jim.jones@uni-muenster.de> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAKAnmmK-U+UicE-qbNU23K--Q5XTLdM6bj+gbkZBZkjyjrd3Ow@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +6 −0 |
| src/backend/utils/error/elog.c | modified | +33 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +1 −0 |
| src/include/libpq/libpq-be.h | modified | +3 −0 |
Documentation touched
Discussion
- Logging which interface was connected to in log_line_prefix 23 messages · 2024-03-06 → 2025-04-07