pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedLimiting line size in Postgres log files
3+ messages / 3 participants
[nested] [flat]
* Limiting line size in Postgres log files
@ 2024-06-26 11:02 Priancka Chatz <pc9926@gmail.com>
2024-06-26 12:19 ` Re: Limiting line size in Postgres log files Laurenz Albe <laurenz.albe@cybertec.at>
2024-06-26 13:25 ` Re: Limiting line size in Postgres log files Ron Johnson <ronljohnsonjr@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Priancka Chatz @ 2024-06-26 11:02 UTC (permalink / raw)
To: pgsql-admin
Hi Pgsql-Admins,
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?
Thank you in advance,
Priyanka C
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Limiting line size in Postgres log files
2024-06-26 11:02 Limiting line size in Postgres log files Priancka Chatz <pc9926@gmail.com>
@ 2024-06-26 12:19 ` Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 0 replies; 3+ messages in thread
From: Laurenz Albe @ 2024-06-26 12:19 UTC (permalink / raw)
To: Priancka Chatz <pc9926@gmail.com>; pgsql-admin
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Limiting line size in Postgres log files
2024-06-26 11:02 Limiting line size in Postgres log files Priancka Chatz <pc9926@gmail.com>
@ 2024-06-26 13:25 ` Ron Johnson <ronljohnsonjr@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Ron Johnson @ 2024-06-26 13:25 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Wed, Jun 26, 2024 at 7:02 AM Priancka Chatz <pc9926@gmail.com> wrote:
> Hi Pgsql-Admins,
>
> 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.
>
That's deeply broken. Presumably you're loading external data; find a
different way of doing it, or disable log_statement.
> Lets say I need to log any statement only upto 10MB.
> Is this possible? Maybe a workaround?
>
>
> Thank you in advance,
> Priyanka C
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-06-26 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 11:02 Limiting line size in Postgres log files Priancka Chatz <pc9926@gmail.com>
2024-06-26 12:19 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-06-26 13:25 ` Ron Johnson <ronljohnsonjr@gmail.com>
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