log_min_messages per backend type
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-12-17T19:14:29Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow log_min_messages to be set per process type
- 38e0190ced71 19 (unreleased) landed
-
Assign "backend" type earlier during process start-up
- 0c8e082fba8d 19 (unreleased) landed
-
Use integer backend type when exec'ing a postmaster child
- f1cd34f95272 19 (unreleased) landed
-
Sort guc_parameters.dat alphabetically by name
- fce7c73fba4e 19 (unreleased) cited
-
Create a separate file listing backend types
- dbf8cfb4f02e 19 (unreleased) cited
Attachments
- v1-0001-log_min_messages-per-backend-type.patch (text/x-patch) patch v1-0001
Hi,
Sometimes you need to inspect some debug messages from autovacuum worker but
you cannot apply the same setting for backends (that could rapidly fill the log
file). This proposal aims to change log_min_messages to have different log
levels depending on which backend type the message comes from.
The syntax was changed from enum to string and it accepts a list of elements.
Instead of enum, it now accepts a comma-separated list of elements (string).
Each element is LOGLEVEL:BACKENDTYPE. It still accepts the old syntax (single
log level for backward compatibility. In this case, it sets all backend types
to the informed log level. For the list, the default log level (WARNING) is
used for the backend types that are not specified.
SET log_min_messages TO 'debug2:checkpointer, debug1:autovacuum';
SHOW log_min_messages;
log_min_messages
----------------------------------------
debug2:checkpointer, debug1:autovacuum
(1 row)
In the above example, it sets log level DEBUG2 to checkpointer process and
DEBUG1 to autovacuum launcher and autovacuum worker processes. The other
processes keep WARNING (default) as log level.
--
Euler Taveira
EDB https://www.enterprisedb.com/