On-prem apigee-postgresql service log rotate

Not applicable

I have a rather large Apigee PostgreSQL log that doesn't appear to be rotating as configured:

1.3G /opt/apigee/var/log/apigee-postgresql/postgresql.log

It looks like log rotate is configured on my postgresql.conf file though:

postgresql.conf:log_truncate_on_rotation=on # If on, an existing log file with the
postgresql.conf: # time-driven rotation, not on restarts
postgresql.conf: # or size-driven rotation. Default is
postgresql.conf:log_rotation_age=1d # Automatic rotation of logfiles will
postgresql.conf:log_rotation_size=10MB # Automatic rotation of logfiles will

Am I missing something simple? Thanks!

0 1 370
1 REPLY 1

Not applicable

@steven wise

Hi Steven,

What is the log_filename parameter set to? You can take a look at the Postgresql documentation for some examples on how using these two parameters should work:

https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html

Example: To keep 24 hours of logs, one log file per hour, but also rotate sooner if the log file size exceeds 1GB, set log_filename to server_log.%H%M, log_truncate_on_rotation to on, log_rotation_age to 60, and log_rotation_size to 1000000. Including %M in log_filename allows any size-driven rotations that might occur to select a file name different from the hour's initial file name.

cheers

Doug