I have a very very old Postgres version 9.2.23 DB that has very little log activity. I want to prevent any logs from being deleted. Currently the log_collector is configured to rotate the logs every day and truncate on rotation. Here are the current settings in /var/lib/pgsql/9.2/data/postgresql.conf:
log_filename = 'postgresql-%a.log'
log_rotation_age = 1d
log_rotation_size = 0
log_truncate_on_rotation = on
Here's my plan for re-configuring the logging so they're never deleted:
- Create a new log file:
touch /var/lib/pgsql/9.2/data/pg_log/perpetual.log - Set
log_filename = 'perpetual.log' - Set
log_rotation_age = 0 - And just for good measure, set
log_truncate_on_rotation = off - Restart Postgres
Will this plan work? Is there an easier way?