select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / REPORTING AND LOGGING

log_min_messages

Read PG 18 manual ↗

Controls which message levels are written to the server log.

Type
enum
Context
superuser
Measured default
warning
Unit
Metadata snapshot
18
Allowed values
debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, panic

Definition PG 18 manual

Controls which message levels are written to the server log. Valid 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. 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.

Measured default history
Version intervalDefault
9.0 – 19warning
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

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. The server-log severity ordering has special placement for LOG and differs from client_min_messages, so a threshold name cannot be copied blindly between them.

log_min_messages is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.

It changes emitted diagnostic data rather than query semantics, but volume, sensitive content, log_line_prefix, destinations, collector throughput, and retention determine operational cost and usefulness.

Operational considerations

Changing log_min_messages in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.

Enabling richer logging without budgeting collector throughput, storage, retention, and downstream query cost.

Writing SQL text, bind values, identities, or host data without a redaction and access-control policy.

Changing log_min_messages globally without a rollback plan and a client or operational compatibility test.

Workload guidance

OLAP: Analytical jobs can justify richer log_min_messages telemetry, but account for long statements, large bind values, and bursty completion patterns in the log pipeline.

OLTP: Tune log_min_messages against an explicit observability question and a measured log-volume budget. Prefer selective thresholds, sampling, or role-level overrides over indiscriminate capture.

SMALL: Keep log_min_messages useful but bounded: verify disk, collector, retention, and redaction capacity before increasing detail or frequency.

Version history 2
  1. PG 18 → 19changed
  2. PG 14 → 15changed

Related entries

Further reading

Definition snapshot: english-manuals:eec6cb9c377dfe7ca4fd2c4d3a6… · English manual source