Accidentially deleted openhab.log

Hi all.

I wanted to have an empty openhab.log and so i deleted it.

i created a new with

sudo nano /var/log/openhab2/openhab.log

but openhab does not write anything in it so i think its because of permissions.

how do i change it to standard?!


Did you try restarting OH. If that still doesn’t work try:

sudo touch /var/log/openhab2/openhab.log
sudo chown openhab:openhab /var/log/openhab2/openhab.log
1 Like

stop OpenHAB
delete your log file
run OpenHAB

1 Like

sudo apt-get update helped me. Thank you guys

For the next time: To make files empty, you redirect empty output into the file. It’s as easy as this:

echo > /var/log/openhab2/openhab.log

This will only modify the content (one empty line) and not the metadata like permissions and file handle. This can safely be done while running openHAB or any other application.