log_line_prefix and JSON log format
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/18/index.html
Description:
I noticed, that it not documented anywhere what log_line_prefix will do, if
log_destination = 'jsonlog' (Or CSV). From my tests it seems it is ignored
and does nothing. But we weren't sure and would be helpful to have this
documented.
On Fri, 2026-09-25 at 09:32 +0000, PG Doc comments form wrote:
Page: https://www.postgresql.org/docs/18/index.html
I noticed, that it not documented anywhere what log_line_prefix will do, if
log_destination = 'jsonlog' (Or CSV). From my tests it seems it is ignored
and does nothing. But we weren't sure and would be helpful to have this
documented.
True; here is a patch.
Yours,
Laurenz Albe
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Fri, 2026-09-25 at 09:32 +0000, PG Doc comments form wrote:
I noticed, that it not documented anywhere what log_line_prefix will do, if
log_destination = 'jsonlog' (Or CSV). From my tests it seems it is ignored
and does nothing. But we weren't sure and would be helpful to have this
documented.
True; here is a patch.
This wording seems like it might add confusion rather than remove it,
because it's not allowing for the fact that log_destination can be
a list. I'd be inclined to write something more along the lines of
"... string that is output at the beginning of each log line that is
sent to stderr, syslog, or eventlog".
regards, tom lane
On Fri, Sep 25, 2026 at 12:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Fri, 2026-09-25 at 09:32 +0000, PG Doc comments form wrote:
I noticed, that it not documented anywhere what log_line_prefix will
do, if
log_destination = 'jsonlog' (Or CSV). From my tests it seems it is
ignored
and does nothing. But we weren't sure and would be helpful to have this
documented.True; here is a patch.
This wording seems like it might add confusion rather than remove it,
because it's not allowing for the fact that log_destination can be
a list. I'd be inclined to write something more along the lines of
"... string that is output at the beginning of each log line that is
sent to stderr, syslog, or eventlog".regards, tom lane
I agree with Tom
On Fri, 2026-09-25 at 11:36 -0400, Tom Lane wrote:
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Fri, 2026-09-25 at 09:32 +0000, PG Doc comments form wrote:
I noticed, that it not documented anywhere what log_line_prefix will do, if
log_destination = 'jsonlog' (Or CSV). From my tests it seems it is ignored
and does nothing. But we weren't sure and would be helpful to have this
documented.True; here is a patch.
This wording seems like it might add confusion rather than remove it,
because it's not allowing for the fact that log_destination can be
a list. I'd be inclined to write something more along the lines of
"... string that is output at the beginning of each log line that is
sent to stderr, syslog, or eventlog".
No objection to your wording.
Yours,
Laurenz Albe
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Fri, 2026-09-25 at 11:36 -0400, Tom Lane wrote:
I'd be inclined to write something more along the lines of
"... string that is output at the beginning of each log line that is
sent to stderr, syslog, or eventlog".
No objection to your wording.
OK, I'll adapt your patch.
regards, tom lane
On Fri, 2026-09-25 at 18:21 -0400, Tom Lane wrote:
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Fri, 2026-09-25 at 11:36 -0400, Tom Lane wrote:
I'd be inclined to write something more along the lines of
"... string that is output at the beginning of each log line that is
sent to stderr, syslog, or eventlog".No objection to your wording.
OK, I'll adapt your patch.
Thanks for picking this up and improving it.
Yours,
Laurenz Albe