CertGrid CertGrid
Hands-on Lab·PostgreSQL

PostgreSQL Server Log Configuration

`logging_collector` is off, `pg_current_logfile()` returns NULL, and there is still a log file. Then four settings that turn it into something worth reading.

Monitoring and Operations Guide 40 of 47 Intermediate

Written against the versions above. `log_connections` became a **list** in PostgreSQL 18 - `receipt`, `authentication`, `authorization`. `on` is still accepted and means all of them. On 17 and earlier it is a plain boolean.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

Before you start

  1. Find the log the packaging actually uses

  2. Read the prefix

  3. Log the slow statements

  4. Log who connects, PostgreSQL 18 style

  5. Log the lock waits

  6. Put it back, and hit a role that will not drop

Official sources