Configuring log rotation for PostgreSQL log files in VMware vCenter Server Appliance
book
Article ID: 338104
calendar_today
Updated On: 03-25-2025
Products
VMware vCenter Server
Issue/Introduction
This article provides steps to configure log rotation for the embedded PostgreSQL database in vCenter Server Appliance
Environment
VMware vCenter Server Appliance 7.x
Resolution
Perform these steps to configure log rotation for the embedded PostgreSQL database:
- Connect to the VCSA through SSH
- Run this command to stop the vCenter service:
service-control --stop vmware-vpxd
- Run this command to stop the PostgreSQL service:
service-control --stop vmware-vpostgres
- Run this command to change the directory to /storage/db/vpostgres/:
cd /storage/db/vpostgres/
- Open the postgresql.conf file with vi:
vi postgresql.conf
- Find the ERROR REPORTING AND LOGGING section and change these lines:
#log_directory = '/var/log/vmware/vpostgres'
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
#log_truncate_on_rotation = off
#log_rotation_age = 1d
to
log_directory = '/var/log/vmware/vpostgres'
log_filename = 'postgresql-%d.log'
log_truncate_on_rotation = on
log_rotation_age = 1440
- Run this command to start the PostgreSQL service:
service-control --start vmware-vpostgres
- Run this command to start the vCenter service:
service-control --start vmware-vpxd
Feedback
Was this article helpful?
thumb_up
Yes
thumb_down
No