vCenter Server vPostgres log rotation fails after 30 days due to date format
book
Article ID: 324290
calendar_today
Updated On:
Products
VMware vCenter Server 7.0VMware vCenter Server 8.0
Issue/Introduction
Symptoms:
Logs stop rotating for the following logs after 30 days:
/var/log/vmware/vpostgres/postgresql.log
/var/log/vmware/vtsdb/postgresql.log
/storage/log partition will be 100% full.
Cause
After 30 days log rotation will stop for the /var/log/vmware/vpostgres/postgresql.log and /var/log/vmware/vtsdb/postgresql.log due to the date format only including the day in the rotated log file name causing log rotate errors when it tries to create a new archive with the same name.
This leads to log files to stop being rotated and eventually fill up the /storage/log partition.
Resolution
Workaround:
Delete the old postgresql.log-0#.gz log files and it will continue rotating.
If it does not continue rotating,
Update /etc/logrotate.d/vmware_postgres_log to this,