Page 1 of 1
Log roll-over to prevent disk-full
Posted: 02 Nov 2013 16:21
by JV
... without changing the log level? Perhaps it can already be done, but the only keywords on logging I find in the config.xml are:
/var/log/Z-Way.log
0
/var/log/Z-Way.log
0
Could you add a roll-over function to the logging? Every couple of weeks my logs fill up and I need the debug level to trap motion messages of my EZMotion sensors that are not captured by z-way due to a bug in the software (I have quite a few, they all don't work).
Thanks for the update.
Posted: 02 Nov 2013 16:21
by pz1
Thanks for the update.
I had missed this from the release notes. I just set up the rotate on my own machine, and will see what happens. In addition I placed a link to this thread in the OpenRemote RaZ-OR documentation (
http://www.openremote.org/display/docs/ ... h+Razberry). I think it might be good if the logrotate was installed by default, as many Pi installations run unattended.
I hadn't noticed the SIGHUP
Posted: 02 Nov 2013 16:21
by pz1
I hadn't noticed the SIGHUP fix in the release notes.
Works for me now. I noticed that because the cronjob is run only once a day, the logfile can grow well beyond 10M. In my case it was 33Mbyte.
This is the task of logrotate
Posted: 02 Nov 2013 16:21
by PoltoS
This is the task of logrotate program, not Z-Way. We will change our installer to configure logrotate for the next release
logrotate.d example
Posted: 02 Nov 2013 16:21
by JV
Thanks for pointing me to logrotate.d. I dropped the following file in /etc/logrotate.d and did a chown root:root.
pi@razberry ~ $ cat /etc/logrotate.d/z-way
/var/log/Z-Way.log {
daily
size 10M
missingok
copytruncate
rotate 3
}
By default there is a logrotate entry in the crontab that is processed daily:
pi@razberry ~ $ cat /etc/cron.daily/logrotate
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
If I don't post here again, assume these settings worked for me.
Please do confirm if this
Posted: 02 Nov 2013 16:21
by pz1
Please do confirm if this works. This thread
http://en.z-wave.me/content/razzberry-p ... g-rotation suggests it won't.
Of course it does! We have
Posted: 02 Nov 2013 16:21
by PoltoS
Of course it does! We have implemented SIGHUP especially for logrotate
