Logrotate using size not working as expected
Summary
Hello, I modified the file /etc/gitlab/gitlab.rb, to enable log rotation, but it doesn't seem to take into account logging['logrotate_size']
Configuration :
logging['svlogd_size'] = 10 * 1024 * 1024 # rotate after 200 MB of log data
logging['svlogd_num'] = 3 # keep 30 rotated log files
logging['svlogd_timeout'] = 24 * 60 * 60 # rotate after 24 hours
logging['svlogd_filter'] = "gzip" # compress logs with gzip
logging['logrotate_frequency'] = "daily" # rotate logs daily
logging['logrotate_size'] = "30M" # do not rotate by size by default
logging['logrotate_rotate'] = 3 # keep 30 rotated logs
logging['logrotate_compress'] = "compress" # see 'man logrotate'
logging['logrotate_method'] = "copytruncate" # see 'man logrotate'
logging['logrotate_postrotate'] = nil # no postrotate command by default
logging['logrotate_dateformat'] = "-%Y-%m-%d"
logrotate['enable'] = true
What is the current bug behavior?
[root@pgitunxweb01 gitlab-rails]# du -sh *
1.8M api_json.log
4.0K application.log
0 githost.log
0 grpc.log
60K integrations_json.log
146M production_json.log
616K production_json.log-2019-04-09.gz
6.4M production_json.log-2019-04-10.gz
124M production.log
300K production.log-2019-04-09.gz
2.9M production.log-2019-04-10.gz
672K sidekiq_exporter.log
0 sidekiq.log
What is the expected correct behavior?
the logrotate_size is set to 30M. So no file should exceed 30M. production_json.log and production.log both do.
Environment
RHEL7
Thanks