openHAB version: 4.2.1
Hi All,
I want to reduce verbosity for the SystemInfo binding, but it does not seem to work.
What I tried:
I went into Add-on Store / Binding / Systeminfo Binding / Cog Wheel, and changed the org.openhab.binding.systeminfo to “Error”.
I understood that this would stop all logs from this binding unless they are genuine errors…
I also validated this with log:list from the
openhab> log:list
Logger │ Level
───────────────────────────────────────────────────┼──────
<<trim other irrelvant log levels>>
org.openhab.binding.mqtt.homeassistant │ INFO
org.openhab.binding.systeminfo │ ERROR
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime │ OFF
su.litvak.chromecast.api.v2.Channel │ ERROR
However, in the openhab Log viewer (frontail), I still see entries like this:
2024-09-05 19:17:39.037 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rez_Systeminfo_Cpu_Load' changed from 0.7 % to 1.2 %
2024-09-05 19:17:39.064 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rez_Systeminfo_CPU_Temperature' changed from 83.8 °C to 84.2 °C
You are showing entries from events.log, not openhab.log. Those cannot simply be reduced pet binding. But you can configure frontail to completely remove events.log from being shown.
events.log shows the logger for openHAB’s Event Bus. The Event Bus is complety separate from all bindings. It logs all ItemStateChangedEvents regardless of where the event came from.
If you have too much in events.log you have lots of options:
Leave it. Who cares how much is in events.log. You can use seraches and other techniques to see or find what you need in Frontail and from the command line. See How to watch and look through logging for how to work with logs from the command line.
Turn off events.log entirely. I’m of the opinion that either events.log is useful or it’s not useful. If it’s useful, it’s important to see everything. If you are going to filter out some things but not others just because some bindings are “chatty” then I’d argue events.log probably just needs to be shut off in the first place. A partial picture of the events going around is worse than no picture.
Configure Frontail not to show events.log. Of course then one must ask what’t the point of having events.log at all.
Turn off logging for ItemStateChangeEvent by setting the logging level to ERROR. Of course this means you won’t see any ItemStateChangeEvents in events.log any more but you’ll still see commands, autoupdate predictions, and Thing status changes. Note that there are lots of other events that don’t get logged as well, see log4j2.xml for the list of all events. Those with a level of ERROR are not logged to events.log.
Filter out those ItemStateChangeEvents for Items you don’t care about using regex filter in the log4j2.xml config. Again, it’s probably better to just shut off the whole log or the ItemStateChangeEvent entirely.
Add profiles to the link between the Channel and these Items to reduce the number of changes that get reported. See Basic Profiles - Transformation Services | openHAB for some useful options for this. However, this will clear up the logs by making it so the Item actually doesn’t change as much.