I’m using Postgres 9.5 on Ubuntu 14.04. I wanted to rotate my logs whenever they reach a certain size. So I edited /etc/postgresql/9.5/main/postgresql.conf and set this
log_rotation_size = 50MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
Then I restarted my server
sudo /etc/init.d/postgresql restart
However after running some operations, I ran out of disk space, and discovered my log had not rotated at all …
myuser@mymachine:~$ ls -al /var/log/postgresql/postgresql-9.5-main.log
-rw-r----- 1 postgres postgres 3165773943 Dec 29 18:34 /var/log/postgresql/postgresql-9.5-main.log
What else do I need to do to get the log rotation to kick in?
log_truncate_on_rotation = on
? What did you set forlog_filename
? See also here: postgresql.nabble.com/…