From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Priancka Chatz <pc9926@gmail.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Limiting line size in Postgres log files
Date: Wed, 26 Jun 2024 14:19:33 +0200
Message-ID: <8d2afa8680c2c9fbf9e22e272b977c6c2542cb32.camel@cybertec.at> (raw)
In-Reply-To: <CANnOdgYdTE0jpzS2hbrnRheTKMsLoTYqcjUMSHUGKt2xWx+j0w@mail.gmail.com>
References: <CANnOdgYdTE0jpzS2hbrnRheTKMsLoTYqcjUMSHUGKt2xWx+j0w@mail.gmail.com>
On Wed, 2024-06-26 at 13:02 +0200, Priancka Chatz wrote:
> Is there a way to set the max size of a line logged in Postgres log?
> Anything beyond a certain size/no-of-character should be logged only till the specified
> size and leave out the rest. I have an instance where the query statements are very long
> (more than 100MB) and I don't need the entire statement to be in my logfile.
> Lets say I need to log any statement only upto 10MB.
> Is this possible? Maybe a workaround?
I don't think that's possible.
If it were not the size of the statement itself, but the number of parameters, you could set
"log_parameter_max_length" so that only a couple of them are displayed, but the statement
itself is logged in its entirety.
You could experiment with syslog logging and set "syslog_split_messages = off".
Syslog will skip logging long lines, but the limit cannot be configured and is
probably shorter than you want.
Yours,
Laurenz Albe
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-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, pc9926@gmail.com
Subject: Re: Limiting line size in Postgres log files
In-Reply-To: <8d2afa8680c2c9fbf9e22e272b977c6c2542cb32.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