From: Laurenz Albe <laurenz.albe@cybertec.at>
To: michael@schoenitzer.de
To: pgsql-docs@lists.postgresql.org
Subject: Re: log_line_prefix and JSON log format
Date: Fri, 25 Sep 2026 17:10:50 +0200
Message-ID: <42af2f4ed8afe739f2e8f8add80100b2ba2d7808.camel@cybertec.at> (raw)
In-Reply-To: <179032875673.1026201.6950455317699774504@wrigleys.postgresql.org>
References: <179032875673.1026201.6950455317699774504@wrigleys.postgresql.org>
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
Attachments:
[text/x-patch] v1-0001-Doc-no-log_line_prefix-in-csvlog-or-jsonlog.patch (1.4K, ../42af2f4ed8afe739f2e8f8add80100b2ba2d7808.camel@cybertec.at/2-v1-0001-Doc-no-log_line_prefix-in-csvlog-or-jsonlog.patch)
download | inline diff:
From 66a669efb0d65a9016d90aa49d7329d709b3776a Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Fri, 25 Sep 2026 17:04:38 +0200
Subject: [PATCH v1] Doc: no log_line_prefix in csvlog or jsonlog
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The documentation didn't make clear that "log_line_prefix" is
not output if "log_destination" is "csvlog" or "jsonlog".
Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reported-by: Michael Schönitzer <michael@schoenitzer.de>
Discussion: https://postgr.es/m/179032875673.1026201.6950455317699774504@wrigleys.postgresql.org
---
doc/src/sgml/config.sgml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgmlindex 0165eb9ec02..f277d311232 100644--- a/doc/src/sgml/config.sgml+++ b/doc/src/sgml/config.sgml@@ -8224,7 +8224,8 @@ local0.* /var/log/postgresql
<listitem>
<para>
This is a <function>printf</function>-style string that is output at the
- beginning of each log line.+ beginning of each log line, except when <varname>log_destination</varname>+ is <literal>csvlog</literal> or <literal>jsonlog</literal>.
<literal>%</literal> characters begin <quote>escape sequences</quote>
that are replaced with status information as outlined below.
Unrecognized escapes are ignored. Other
--
2.55.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: laurenz.albe@cybertec.at, michael@schoenitzer.de, pgsql-docs@lists.postgresql.org
Subject: Re: log_line_prefix and JSON log format
In-Reply-To: <42af2f4ed8afe739f2e8f8add80100b2ba2d7808.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox