Configuration parameter

log_replication_commands — PostgreSQL configuration parameter

Category Error Reporting and Logging Default off

Causes each replication command and walsender process’s replication slot acquisition/release to be logged in the server log.

At a glance

Property Value
Parameter log_replication_commands
Category Error Reporting and Logging
Default off
Value type boolean (on/off)
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Causes each replication command and walsender process’s replication slot acquisition/release to be logged in the server log. See protocol_replication for more information about replication command. The default value is off. Only superusers and users with the appropriate SET privilege can change this setting.

(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_replication_commands; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'log_replication_commands';.

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_replication_commands.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters