Logfiles stop logging

Hey guys!

I’m currently having an issue with my log files. When I start openHAB, openhab.log / events.log start logging as expected. At some point though, no new entries get added to the log files. Sometimes it’s 20 minutes later, sometimes 3 hours - totally random. The rest of OH works as usual. There’s also nothing irregular in the logs just before it stops.
I already re-downloaded the log4j2.xml, but that didn’t help.

The only thing I noticed is this in dsmeg, I’m not sure if that could be related though:

[10410.361696] systemd-journald[899]: /var/log/journal/1fb0bf70d28e4417ab7c45e395d422ad/user-1001.journal: Journal file has been deleted, rotating.
[10410.361711] systemd-journald[899]: Failed to write entry to /var/log/journal/1fb0bf70d28e4417ab7c45e395d422ad/user-1001.journal (21 items, 834 bytes), rotating before retrying: Identifier removed

I had the same issues with the logfiles when using an SSD as a test scenario, so I guess that would rule a corrupted SD card out.

Any ideas on what could be causing this are highly appreciated.

  • Platform information:
    • Hardware: Raspberry Pi 5 Model B Rev 1.0, 4GB, 32 GB MicroSD
    • OS: openHABian v1.9c
    • Java Runtime Environment: openjdk version “17.0.11” 2024-04-16
    • openHAB version: 4.1.3

Cheers

I’ve noticed my logs stopped about 24 hours after migration to OH 4.1.2 running on raspberry pi 4 and openhabian 1.9.

Fixed my issues after finding this post, Solution. The last line on /var/lib/openhab/etc/log4j2.xml has a broken tag.

Same issue here. New installation of Openhabian from an image (4.1.2)

There is no issue with log4j2.xml as suggested by pguima. I even tried with a clean version of log4j2.xml from the Openhab repository.

If I type “log:tail” in the console, all messages are shown and the log files start to update.
After a couple of hours the logging stops again (the files show no updates).

Yup, log4j2.xml is fine on my side as well.
However, when I run log:tail on the console, I see like the last (most current) 50 entries or so but then it ends with Error executing command: Unable to set level for logger.
When I run it again a bit later, I also get the latest entries (so it does update), but it still ends with Error executing command: Unable to set level for logger.

Thing is: the log files don’t get updated - events and openhab.log both stopped updating at 0:04 this time.

Try disabling zram sync systemctl disable --now zsync.timer.
issue some log related command on OH console like log:set debug xzy to get logs going again.

Even stranger: Logging worked until 12:02 PM today.
Then suddenly the frontail view started scrolling through older events for several seconds and stopped at 10:25AM.
events.log got a new timestamp of 10:25AM
Logging is now stuck
As soon as I issued the log:tail command the logging started working again, but entries between 10:25 and 12:02 are lost.

zram issue?

Thanks for your reply. I tried what you suggested, unfortunately log:set debug 291 still returns Error executing command: Unable to set level for logger.

I have the same issue but I’m not using zram. I did a full reinstall on a fresh SSD and restored my backup, but it still stops logging after a certain amount of time (usually around 30 mins).

I just tested the log:tail command and then logging resumes.

I just noticed that events.log keeps updating while openhab.log is stuck at midnight 3 days ago.

This thread made me wonder, so i checked. My openhab.log is fine, but my events.log stopped logging in november '23 (!). I’m on Openhabian, 4.1.1 - Release Build and using zram with plenty of space:
df -h /var/log
Filesystem Size Used Avail Use% Mounted on
overlay2 974M 57M 850M 7% /var/log