Log roll-over to prevent disk-full

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
JV
Posts: 15
Joined: 14 Jun 2013 02:40

Log roll-over to prevent disk-full

Post 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).
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Thanks for the update.

Post 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.
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

I hadn't noticed the SIGHUP

Post 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.
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

This is the task of logrotate

Post by PoltoS »

This is the task of logrotate program, not Z-Way. We will change our installer to configure logrotate for the next release
JV
Posts: 15
Joined: 14 Jun 2013 02:40

logrotate.d example

Post 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.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Please do confirm if this

Post by pz1 »

Please do confirm if this works. This thread http://en.z-wave.me/content/razzberry-p ... g-rotation suggests it won't.
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Of course it does! We have

Post by PoltoS »

Of course it does! We have implemented SIGHUP especially for logrotate ;)
Post Reply