Configuring PostgreSQL log rotation The PostgreSQL log contains logging information for the PostgreSQL database that is packaged with the Secure Agent.
The PostgreSQL log is available in the following directory:
<Secure Agent installation directory>\apps\process-engine\logs\PostGreSql\postgresql.log
The PostgreSQL log can become very large and difficult to manage over time. You can configure log rotation to reduce the file size and manage the file easily. You can configure log rotation based on time or file size.
1 Create a file named user.conf in the following location if it does not already exist:
<Secure Agent installation directory>\apps\process-engine\data\PostGreSql\Data
The user.conf file overrides the values defined in the postgresql.conf file.
2 Perform one of the following steps:
- To rotate the logs based on time, add the following properties to the user.conf file:log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_rotation_age=<value in minutes>
For example, if you set the value of the log_rotation_age property to 1440, the log file will be rotated every day.
- To rotate the logs based on file size, add the following properties to the user.conf file:log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log’ log_rotation_size=<value in kilobytes> log_truncate_on_rotation=on
For example, if you set the value of the log_rotation_size property to 10240, the log file will be rotated when the file size exceeds 10 MB.
3 Save the user.conf file.
4 Restart the PostgreSQL database for the change to take effect.