Configuration parameter

log_min_messages — PostgreSQL configuration parameter

Category Error Reporting and Logging Default WARNING, which applies that level to all process types

Controls which message levels are written to the server log.

At a glance

Property Value
Parameter log_min_messages
Category Error Reporting and Logging
Default WARNING
Value type string
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Controls which message levels are written to the server log. The value is a comma-separated list of zero or more process type:level entries and exactly one mandatory level entry, which becomes the default for process types not listed. Valid process types are listed in the table below. archiver autovacuum backend bgworker bgwriter checkpointer checksums ioworker postmaster slotsyncworker startup syslogger walreceiver walsender walsummarizer walwriter Valid level values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, and PANIC. Each level includes all the levels that follow it. The later the level, the fewer messages are sent to the log. The default is WARNING, which applies that level to all process types. Note that LOG has a different rank here than in client_min_messages. Only superusers and users with the appropriate SET privilege can change this setting.

Example: To log walsender and autovacuum at level DEBUG1 and everything else at ERROR, set log_min_messages to error, walsender:debug1, autovacuum:debug1.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW log_min_messages; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'log_min_messages';.

Tuning guidance

Tune this for observability versus log volume, not for raw performance. More verbose logging helps diagnose problems but costs disk and I/O; quieter logging saves space but hides detail. Pick a level your log pipeline can store and search, and raise verbosity temporarily when investigating an incident.

Reference

PostgreSQL documentation — log_min_messages.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters