Description of problem: Rotate engine.log by size not working - logrotate Version-Release number of selected component (if applicable): RHEVM 3.3 - IS10 environment: RHEVM: rhevm-3.3.0-0.15.master.el6ev.noarch PythonSDK: rhevm-sdk-python-3.3.0.10-1.el6ev.noarch VDSM: vdsm-4.12.0-61.git8178ec2.el6ev.x86_64 LIBVIRT: libvirt-0.10.2-18.el6_4.9.x86_64 QEMU & KVM: qemu-kvm-rhev-0.12.1.2-2.355.el6_4.5.x86_64 SANLOCK: sanlock-2.8-1.el6.x86_64 How reproducible: 100 % Steps to Reproduce: Run multiples action in RHEVM - work in scale environment Actual results: engine.log reached 1.2Gb size logrotate in engine.log by size not working Expected results: engine.log should rotate when log reached 10Mb Impact on user: Can't edit or copy such large file to another machine Workaround: none Additional info: ------------------------------------------------------------------------------- [root@kipi-rhevm ~]# less /etc/logrotate.d/ovirt-engine "/var/log/ovirt-engine/engine.log" "/var/log/ovirt-engine/server.log" { daily minsize 10M missingok copytruncate rotate 20 compress } "/var/log/ovirt-engine/host-deploy"/*.log { monthly missingok compress nocreate rotate 1 } "/var/log/ovirt-engine/dump"/*.hprof { daily missingok compress nocreate rotate 1 } ------------------------------------------------------------------------------- [root@kipi-rhevm ~]# cd /var/log/ovirt-engine/ [root@kipi-rhevm ovirt-engine]# [root@kipi-rhevm ovirt-engine]# ls -tarhl total 1.2G drwxr-xr-x. 2 ovirt ovirt 4.0K Aug 13 17:28 notifier drwxr-xr-x. 2 ovirt ovirt 4.0K Aug 13 17:28 dump drwxr-xr-x. 2 root root 4.0K Aug 14 22:56 setup drwxr-xr-x. 8 root root 4.0K Aug 18 03:18 .. -rw-r--r--. 1 ovirt ovirt 1.1M Aug 19 03:31 engine.log-20130819.gz -rw-r--r--. 1 ovirt ovirt 657 Aug 19 12:13 boot.log -rw-r--r--. 1 ovirt ovirt 91K Aug 19 15:51 redhat-support-plugin-rhev.log drwxr-xr-x. 2 ovirt ovirt 16K Aug 19 23:59 host-deploy -rw-r--r--. 1 ovirt ovirt 2.2M Aug 21 00:20 server.log -rw-r--r--. 1 ovirt ovirt 6.2M Aug 21 03:19 engine.log-20130821.gz drwxr-xr-x. 6 ovirt ovirt 4.0K Aug 21 03:19 . -rw-r--r--. 1 ovirt ovirt 1010K Aug 21 13:26 console.log -rw-r--r--. 1 ovirt ovirt 1.2G Aug 21 13:44 engine.log [root@kipi-rhevm ovirt-engine]# [root@kipi-rhevm ovirt-engine]# date Wed Aug 21 13:50:36 IDT 2013 /var/log/ovirt-engine/engine.log /var/log/vdsm/vdsm.log
Workaround if engine.log is too large, run following command: logrotate --force /etc/logrotate.d/ovirt-engine
Normally, linux logrotate runs once a day (by a cronjob), and is not size based (it has a minsize that tell logrotate the minimal size of log file to rotate). It looks like we're using the mechanism as intended, so I'm not sure why you wrote "Expected results: engine.log should rotate when log reached 10Mb" Why do you think that's the expected behaviour?
Per bug#948481, ovirt-engine is now well behaved component, this means that logrotate is in charge of rotating log instead of proprietary rotation. It has many advantages, such as sysadmin to know what and how to change log rotation without digging into application, and at application side it reduces the need to maintain rotation logic and configuration. The disadvantage is that by default logrotation is executed once a day. On busy systems, log rotation can be executed in higher intervals, this is up to sysadmin to configure. Marking as duplicate of bug#948481. *** This bug has been marked as a duplicate of bug 948481 ***