log_directory
Read PG 18 manual ↗When logging_collector is enabled, this parameter determines the directory in which log files will be created.
- Type
- string
- Context
- sighup
- Measured default
- log
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
When logging_collector is enabled, this parameter determines the directory in which log files will be created. It can be specified as an absolute path, or relative to the cluster data directory. This parameter can only be set in the postgresql.conf file or on the server command line. The default is log.
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 9.6 | pg_log |
| 10 – 19 | log |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
log_directory sets the destination directory for log files. Can be specified as relative to the data directory or as absolute path. A relative path is resolved below the data directory, while an absolute path can place collector-managed files on a separate filesystem.
log_directory is a SIGHUP-context setting: a configuration reload activates the new server value without a restart; subsequent operations that consult it use the refreshed value.
The active path is composed from log_destination, logging_collector or syslog/eventlog, file naming and permissions, rotation triggers, and external shipping or retention.
Operational considerations
Editing log_directory without reloading configuration and verifying the effective value and subsequent behavior.
Combining incompatible destination, collector, filename, and rotation assumptions and then losing or overwriting logs.
Failing to monitor a full or unwritable log target, which can block logging or database activity depending on the path.
Changing log_directory globally without a rollback plan and a client or operational compatibility test.
Workload guidance
OLAP: Size the log_directory path for bursty analytical output and verify that rotation or downstream ingestion cannot stall database processes.
OLTP: Set log_directory as part of one end-to-end logging design. Validate collector behavior, rotation, ownership, shipping, retention, and recovery from a full destination.
SMALL: Use a bounded, easily rotated log_directory configuration and monitor free space; a small node should not retain redundant formats or unlimited files.
Version history 1
- PG 9.6 → 10changed
Related entries
Further reading
Definition snapshot: english-manuals:357689179e6237f7f6c1a753f29… · English manual source