logrotate fpr openhab.log

243 views
Skip to first unread message

Christoph Wempe

unread,
Sep 27, 2014, 6:09:09 AM9/27/14
to ope...@googlegroups.com
I was wondering if there is a reason the openhab.log does not get rotated.

The event.log gets rotated every week and even compressed to zip.
And the *.request.log creates a new file every day and files older than 21 days get removes, I think.

My openhab.log gets very big over the time.
I think it would make sense to rotate and compress this as well.

And I wonder if it would be better to use the same rotate rule for all log files.
For the sake of consistency. ;)

Kai Kreuzer

unread,
Sep 27, 2014, 6:13:12 AM9/27/14
to ope...@googlegroups.com
Hi Christoph,

This should be in place since https://github.com/openhab/openhab/pull/1387 already :-)

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Christoph Wempe

unread,
Sep 27, 2014, 6:38:56 AM9/27/14
to ope...@googlegroups.com
So this is fixed in 1.5.1?!
Great.

Thomas E.-E.

unread,
Oct 2, 2014, 11:48:50 AM10/2/14
to ope...@googlegroups.com

Marcolino

unread,
Oct 12, 2014, 12:13:20 PM10/12/14
to ope...@googlegroups.com
Hi Christoph,
if you're running on Linux, you can use logrotate daemon. Under Debian I use this configuration file:

/opt/openhab/logs/openhab.log {
daily
rotate=10
missingok
compress
postrotate
                /etc/init.d/openhab restart > /dev/null
    endscript
}

It means that rotate log daily and keep last 10 days. After rotation restart OpenHab to force it to write a new openhab.log.
I also rotate events.log

Regards
Marco

Christoph Wempe

unread,
Oct 12, 2014, 6:42:57 PM10/12/14
to ope...@googlegroups.com
Thanks
Reply all
Reply to author
Forward
0 new messages