public inbox for [email protected]
help / color / mirror / Atom feedRe: Q: limit the length of log file entries?
2+ messages / 2 participants
[nested] [flat]
* Re: Q: limit the length of log file entries?
@ 2025-09-03 15:56 Adrian Klaver <[email protected]>
2025-09-04 15:48 ` Re: Q: limit the length of log file entries? Albrecht Dreß <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Klaver @ 2025-09-03 15:56 UTC (permalink / raw)
To: Albrecht Dreß <[email protected]>; [email protected]
On 9/3/25 08:40, Albrecht Dreß wrote:
> Hi all,
>
> I wonder if it would be possible to limit the length of individual log lines being written to the log file.
>
> Background:
> I have a PL/PGsql DB function 'addval(_id text, _data bytea) RETURNS VOID'. When a broken bytea is passed as 2nd parameter, something like
>
> albrecht@test FEHLER: ungültige hexadezimale Ziffer: »r« bei Zeichen 28
> albrecht@test ANWEISUNG: SELECT FROM addval('hopp', '\xbroken')
>
> is printed in the log file. This is fine and very helpful in this case, but I have a “friendly user” who transmitted a broken hex string of ~100 KBytes as second parameter, resulting in a log line of this size which is not really readable and when done frequently quickly fills the logs.
>
> The log settings are, inter alia
>
> log_parameter_max_length = 256
> log_parameter_max_length_on_error = 256
> log_error_verbosity = TERSE
Did you reload the server after making the above changes?
Did you take a look at output from:
https://www.postgresql.org/docs/current/view-pg-settings.html
for appropriate settings name to see if something is overriding the
settings you changed?
>
> but seem to have not the desired effect in this case.
Did it have any effect?
>
> I use PostgreSQL version 17.6-1.pgdg13+1 on Debian Trixie.
>
> Thanks in advance for any help,
> Albrecht.
--
Adrian Klaver
[email protected]
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Q: limit the length of log file entries?
2025-09-03 15:56 Re: Q: limit the length of log file entries? Adrian Klaver <[email protected]>
@ 2025-09-04 15:48 ` Albrecht Dreß <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Albrecht Dreß @ 2025-09-04 15:48 UTC (permalink / raw)
To: Adrian Klaver <[email protected]>; +Cc: [email protected]
Am 03.09.25 17:56 schrieb(en) Adrian Klaver:
> Did you reload the server after making the above changes?
Sure, running “systemctl reload …”.
> Did you take a look at output from:
>
> https://www.postgresql.org/docs/current/view-pg-settings.html
>
> for appropriate settings name to see if something is overriding the
> settings you changed?
Yes:
<snip>
postgres=# select name, setting, unit from pg_settings where name like 'log_parameter_%' or name = 'log_error_verbosity';
name | setting | unit
-----------------------------------+---------+------
log_error_verbosity | terse |
log_parameter_max_length | 256 | B
log_parameter_max_length_on_error | 256 | B
(3 Zeilen)
</snip>
Thanks,
Albrecht.
Attachments:
[application/pgp-signature] openpgp-digital-signature.asc (488B, 2-openpgp-digital-signature.asc)
download
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-09-04 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-03 15:56 Re: Q: limit the length of log file entries? Adrian Klaver <[email protected]>
2025-09-04 15:48 ` Albrecht Dreß <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox