Re: Truncate logs by max_log_size
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Kirill Gavrilov <diphantxm@gmail.com>
Cc: Kirill Reshke <reshkekirill@gmail.com>,
"Andrey M. Borodin" <x4mmm@yandex-team.ru>, Euler Taveira
<euler@eulerto.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-11-29T19:12:44Z
Lists: pgsql-hackers
On 29.11.24 12:05, Kirill Gavrilov wrote: > Setting max_log_size to 0 already disables truncation. > I changed guc units to bytes, just to make it more human-friendly. > Did some refactoring and fixed all warnings. Set default value in > postgresql.conf. Nice. The patch applies cleanly and the warnings are gone. A few other things: IMHO the documentation can be a bit clearer. It says to input the values in bytes, but the default value is in megabytes. + If greater than zero, each query logged is truncated to this many bytes. + Zero disables the setting. + Default value is 5MB. Perhaps something like "If this value is specified without units, it is taken as bytes." (see wal_keep_size) And a pedantic note: This hint suggests that you can use TB as unit .. postgres=# set max_log_size = '1foo'; ERROR: invalid value for parameter "max_log_size": "1foo" HINT: Valid units for this parameter are "B", "kB", "MB", "GB", and "TB". .. but it can never be used, as it exceeds the integer range: postgres=# SET max_log_size = '1TB'; ERROR: invalid value for parameter "max_log_size": "1TB" HINT: Value exceeds integer range. Thanks -- Jim
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix log_statement_max_length test with verbose logs
- 9bfbf5bf6190 master landed
-
Add log_statement_max_length GUC to limit logged statement text
- c8bd8387c27a master landed
-
Improve user control over truncation of logged bind-parameter values.
- 0b34e7d307e6 13.0 cited