The default postgresql.conf file created using initdb contains the following line
#logging_collector = off # Enable capturing of stderr and csvlog
Is there anyway to force initdb itself to generate a file with
logging_collector = on
rather than set options on pg-ctl or edit the generated file.
I keep all the changes in a separate file named
custom.confThen after
initdbran, I copy the file to the data directory and append anincludedirective topostgresql.conf:These steps are easily scriptable, so no manual intervention required.
Alternatively you can skip the copy step and include the config file directly from the central directory. Or you could use
include_dirto include the whole directory where your custom config file is stored.This has the added benefit (in my opinion) that I have all customizations in a single file. I don't need to go through
postgresql.confto find settings that are changed from the default.