Configuration parameter

syslog_sequence_numbers — PostgreSQL configuration parameter

Category Error Reporting and Logging Change scope Sighup

When logging to syslog and this is on (the default), then each message will be prefixed by an increasing sequence number (such as [2]).

At a glance

Property Value
Parameter syslog_sequence_numbers
Category Error Reporting and Logging
Default (see documentation)
Value type boolean (on/off)
Change scope Reload (postgresql.conf, SIGHUP)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

When logging to syslog and this is on (the default), then each message will be prefixed by an increasing sequence number (such as [2]). This circumvents the “— last message repeated N times —” suppression that many syslog implementations perform by default. In more modern syslog implementations, repeated message suppression can be configured (for example, $RepeatedMsgReduction in rsyslog), so this might not be necessary. Also, you could turn this off if you actually want to suppress repeated messages.

This parameter can only be set in the postgresql.conf file or on the server command line.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Set it in postgresql.conf (or with ALTER SYSTEM) and reload with SELECT pg_reload_conf(); or pg_ctl reload — no restart needed.

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

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 — syslog_sequence_numbers.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters