Hi all,
For some reason the log truncation doesn't seem to be working on my server.
I have set log_rotation_age to 1 day and log_truncate_on_rotation to on.
log_destination | csvlog,syslog | Sets the destination for server log output.
log_directory | pg_log | Sets the destination directory for log files.
log_filename | postgresql-%a.log | Sets the file name pattern for log files.
log_rotation_age | 1d | Automatic log file rotation will occur after N minutes.
log_rotation_size | 0 | Automatic log file rotation will occur after N kilobytes.
log_truncate_on_rotation | on | Truncate existing log files of same name during log rotation.
server_version | 8.4.12 | Shows the server version.
Log timezone is UTC.
What is happening is that I get log files that continue to get appended with each rotation instead of getting truncated.
So, in postgresql-Fri.csv, I see this:
2012-07-20 23:59:12.146 UTC,"sysdba",5950,"[local]",5009f054.173e,173,"COMMIT",2012-07-20 23:57:08 UTC,3/0,0,LOG,00000,"duration: 0.353 ms statement: COMMIT;;",,,,,,,,
2012-07-27 00:00:03.044 UTC,"sysdba",26539,"[local]",5011da03.67ab,1,"SELECT",2012-07-27 00:00:03 UTC,6/0,0,LOG,00000,"duration: 0.423 ms statement: select datname, oid from pg_database",,,,,,,,
A jump from Friday the 20th to Friday the 27th with no truncation.
I don't have any periodic scheduled Postgres restarts but the server does get restarted frequently.
How can I fix this so that it gets truncated when it rolls around to the same day of the week again?
Thanks and Regards,
James