log_directory
A configuration parameter determining the directory where log files are stored
log_directory
is a configuration parameter determining the directory on the local file system where log files are stored.
log_directory
was added in PostgreSQL 8.0.
Default value
The default value for log_directory
is:
- PostgreSQL 10 and later:
log
- PostgreSQL 8.0 ~ 9.6:
pg_log
Usage
log_directory
is only applied when logging_collector
is set to on
. The directory can be specified as an absolute path (e.g. /var/log/postgresql
) or relative to the data directory (e.g. log
).
Note that it is possible to set log_directory
to an arbitrary subdirectory within the data directory (e.g. pg_replslot
) but this is not recommended and may lead to unexpected side-effects.
The current value of log_directory
can only be viewed by superusers or members of the default role
pg_read_all_settings
.
Change history
- PostgreSQL 10
- default changed from
pg_log
tolog
(commit 3371e4d9)
- default changed from
- PostgreSQL 8.0
- added (commit bdf8ef69)
References
- PostgreSQL documentation: log_directory