I try to limit PostgreSQL logs based on size.
I have tried to configure logs configuration like that:
log_destination = 'csvlog'
logging_collector = on
log_directory = '/var/log/pgsql'
log_filename = 'postgresql-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 100kB
The logs rotate based on age works well, but the sized based rotation doesn't seem to work.
I have limited the log size to 100kB but the csv file's size is growing up to 600MB.
Eventually, there is only one file created by the 'size based rotation' which is 1.5MB (postgresql-Sun.csv-20210502.gz).
How can I make the log rotation work based on size?
Postgresql version - 12.2