Allow log_min_messages to be set per process type

Change log_min_messages from being a single element to a comma-separated
list of type:level elements, with 'type' representing a process type,
and 'level' being a log level to use for that type of process.  The list
must also have a freestanding level specification which is used for
process types not listed, which convenientely makes the whole thing
backwards-compatible.

Some choices made here could be contested; for instance, we use the
process type `backend` to affect regular backends as well as dead-end
backends and the standalone backend, and `autovacuum` means both the
launcher and the workers.  I think it's largely sensible though, and it
can easily be tweaked if desired.

Author: Euler Taveira <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Japin Li <[email protected]>
Reviewed-by: Tan Yang <[email protected]>
Discussion: 
https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38e0190ced714b33c43c9676d768cc6814fc662a

Modified Files
--------------
doc/src/sgml/config.sgml                      |  52 ++++--
src/backend/commands/extension.c              |   2 +-
src/backend/postmaster/launch_backend.c       |   2 +-
src/backend/utils/error/elog.c                | 247 +++++++++++++++++++++++++-
src/backend/utils/init/miscinit.c             |   2 +-
src/backend/utils/misc/guc_parameters.dat     |  10 +-
src/backend/utils/misc/guc_tables.c           |  13 +-
src/backend/utils/misc/postgresql.conf.sample |  16 +-
src/include/postmaster/proctypelist.h         |  42 ++---
src/include/utils/guc.h                       |   5 +-
src/include/utils/guc_hooks.h                 |   2 +
src/test/regress/expected/guc.out             |  57 ++++++
src/test/regress/sql/guc.sql                  |  22 +++
13 files changed, 428 insertions(+), 44 deletions(-)

Reply via email to