allow collecting sync-container Postgres logs via Docker logging driver

Reported

user wants to ingest the dblab sync container's Postgres logs in their external logging system (Loki/ELK/etc.) the same way they ingest any other Docker container - via the Docker logging driver. they reported that DLE forces csvlog to PGDATA/log and "doesn't allow altering the config, at least for the sync instance".

Reality

the part about it being unalterable is wrong. the control config at engine/configs/standard/postgres/control/postgresql.conf sets log_destination = 'csvlog' + logging_collector = on, but the dblab include chain (see pgconfig.Manager, internal/provision/databases/postgres/pgconfig/configuration.go) is:

postgresql.dblab.postgresql.conf   # control defaults land here
postgresql.dblab.pg_control.conf
postgresql.dblab.recovery.conf
postgresql.dblab.sync.conf         # sync.configs: from server.yml
postgresql.dblab.promotion.conf
postgresql.dblab.snapshot.conf
postgresql.dblab.user_defined.conf

last-setting-wins, so the existing retrieval.spec.physicalRestore.options.sync.configs: block can already flip the sync postmaster to stderr. verified on a sync container:

$ docker exec dblab_sync_<id> psql -tAc \
  "select name, setting from pg_settings where name in ('log_destination','logging_collector');"
log_destination|stderr
logging_collector|off
$ docker logs dblab_sync_<id> | tail -1
2026-05-12 09:12:24.730 UTC [783] LOG:  duration: 0.012 ms  execute stmtcache_...

so the problem is really:

  1. the override isn't documented anywhere - users don't know it's available
  2. when collector is off, tools.PrintLastPostgresLogs (which globs *.csv and tails the newest) prints nothing on failure paths, degrading sync-container diagnostics

Scope

sync container only. clones have the same override mechanism, but disabling csvlog there silently breaks the CI Observer (internal/observer/observer.go) and idle-clone detection (Provisioner.LastSessionActivity) - both parse csv columns. that's a larger piece of work for a separate issue.

Fix

see !1146 (merged):

  • add commented-out example under sync.configs in the three config.example.physical_*.yml files showing log_destination: stderr + logging_collector: "off", with a note about jsonlog (Postgres 15+)
  • PrintLastPostgresLogs falls back to ContainerLogs --tail 20 when no CSV exists in PGDATA/log, so failure diagnostics still surface useful output when the collector is disabled
Edited by Artyom Kartasov