DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Reporting and Logging / When to Log

log_min_messages

Sets the message levels that are logged. Each level includes all the levels that follow it. The later the level, the fewer messages are sent.

  • Default: warning
  • Type: enum
  • Values: debug5 · debug4 · debug3 · debug2 · debug1 · info · notice · warning · error · log · fatal · panic
  • Applies: Session (superuser)

In plain words

Every message has a severity, from chatty DEBUG to PANIC. This setting is the bar a message must reach to be written to the server log. The default warning keeps warnings, errors and serious problems and skips the chatter.

Lowering it to a debug level produces huge amounts of output; only do it briefly while chasing a problem.

For DBAs and operators

Order for the server log: debug5 < … < debug1 < info < notice < warning < error < log < fatal < panic. Note that LOG ranks between ERROR and FATAL: operational messages (checkpoints, connections, slow statements, autovacuum) are written even when you set log_min_messages = error. Setting it to fatal or panic hides them, which is almost never wanted. For messages sent to the client the order is different (see client_min_messages).

Real examples of each level (18.6):

DEBUG: probing availability of JIT provider at /usr/lib/postgresql/18/lib/llvmjit.so (debug1) DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0 (debug5) INFO: vacuuming "shop.public.orders" NOTICE: table "tmp_import" does not exist, skipping WARNING: there is no transaction in progress ERROR: division by zero LOG: checkpoint starting: time FATAL: role "alice" does not exist

All debug levels print as DEBUG:. A superuser can raise verbosity for one session only, which is much safer than a global change:

SET log_min_messages = debug2;   -- this backend only
-- reproduce the problem
RESET log_min_messages;

A related trick: PGOPTIONS='-c log_min_messages=debug1' psql …. Debug output from background processes (autovacuum, walsender) requires changing the server-wide value and reloading.

How to change it

A superuser (or a role granted SET) can change it per session with SET.

See it in context

Logger (logging collector)

Related parameters

client_min_messages log_min_error_statement log_error_verbosity log_line_prefix

All Reporting and Logging parameters