8.4.12 log truncation not working? - Mailing list pgsql-novice

From pg noob
Subject 8.4.12 log truncation not working?
Date
Msg-id CAPNY-2XoHM8Z8Zkr3fLVT=Q6-Efdf4Hq7SPC_8o17RJPvjRViA@mail.gmail.com
Whole thread Raw
Responses Re: 8.4.12 log truncation not working?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice

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

pgsql-novice by date:

Previous
From: Ioannis Anagnostopoulos
Date:
Subject: Re: Running analysis as part of a stored proc
Next
From: Tom Lane
Date:
Subject: Re: 8.4.12 log truncation not working?