Type: | integer |
Default: | 1440 (1d) |
Min: | 0 (0min) |
Max: | 35791394 (35791394min) |
Unit: | minutes (min) |
Context: | sighup |
Restart: | false |
When logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created. If this value is specified without units, it is taken as minutes. The default is 24 hours. Set to zero to disable time-based creation of new log files. This parameter can only be set in the postgresql.conf file or on the server command line.
Recommendations
1d is generally good for production. Set to 1h to rotate logs hourly when doing performance analysis.
On StackOverflow
- How to create a log file in pg_log directory for each execution of my function
- Postgres 9.3 workload consumes all of memory and swap
- postgres: how to turn on logging?
- Transactions & write performance when calling function externally
- How to customize the configuration file of the official PostgreSQL Docker image?