How to watch and look through logging

Hey there, hoping someone might be able to shed some light on what is going on with my system with respect to logging. I am a relative beginner to this stuff. Hope this is the right place for the post. About 2-3 months ago with some system upgrade my events.log went from including only item state changes to including all item state updates. The vast majority of the time updating the item with the exact same value which it was previously - for example, the following repeats at least several thousand times through the day, every day and this is just one Item!

2023-06-08 21:18:01.366 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'MarkPhone' updated to ON

With almost 1k items my log has become almost unusable for finding meaningful information about state changes as I used to be able to do. I used to be able to see the last 30 minutes or so of logging when I open openhabian:8080 in a browser but now it is only the last ~2 minutes.

I have tried using the above and the info here to change the logger “openhab.event.ItemStateEvent” to WARN or DEBUG instead of INFO as it is currently (I did this with log:set from the console) but the system continues to log all state updates instead of just state changes as it used to do. I have also explored the file log4j2.xml to see if what I am trying to add to the file is making it in there, and it is indeed:

name="org.openhab.core.items.events.ItemStateUpdatedEvent"/>
		<Logger level="WARN" 
name="org.openhab.core.items.events.GroupStateUpdatedEvent"/>
		<Logger level="WARN" 

I am obviously misunderstanding something - any help would be greatly appreciated. I’m on a RP4B using Openhabian and OH 4.0.0.M3. The problem has persisted through at least two milestone updates, if that is relevant. Thanks so much in advance for any guidance :+1: I am on the verge of starting from scratch with an Openhabian backup and fresh install/restore (but I worry the problem would persist b/c of the restore) :thinking:

No, the right place would be a new thread in the Setup, Configuration and Use category.

You are running OH 4 and missed checking the announcements and/or monitoring the discussion thread. There are two new update events which are not suppressed by default. If you keep your existing log4j2.xml file during the upgrade, you won’t get the changes to that file that suppress the logging of these new events.

That syntax is incorrect. For one, assuming it’s not a copy and paste mistake it’s not even correct XML.

In the Logger section of the file you should have

...
                <!-- openHAB specific logger configuration -->

                <Logger level="INFO" name="org.openhab"/>

                <Logger level="ERROR" name="openhab.event.ItemStateEvent"/>
                <Logger level="ERROR" name="openhab.event.ItemStateUpdatedEvent"/>
                <Logger level="ERROR" name="openhab.event.GroupStateUpdatedEvent"/>
                <Logger level="ERROR" name="openhab.event.ItemAddedEvent"/>
...
1 Like

Thanks for the response.

Noted. In light of us both having already irrevocably posted in this oh so inappropriate thread…

Exactly what I needed thank you! Yes you are correct, monitoring threads is not my forte/priority (358 posts at present). I did read the announcements as those are more of a priority and are more succinct - but obviously not thoroughly enough or perhaps I just did not understand what I was reading secondary to being a relative beginner as I mentioned. Appreciate your patience. I found the reference you mentioned and was able to fix my problem :+1:

That actually is the syntax in my log4j2 file. Tbh I just don’t understand it (as I mentioned previously I am a relative beginner and do not speak XML). I was confused by the way that WordPad opened the file with strange spacing which I now realize was stupidly due to text wrapping. This strangely carried over into what I copied/pasted, as you suspected, so I unknowingly copied half of a statement. Anyway turns out when I did my log:set I had added “org.openhab.core.items.events.GroupStateUpdatedEvent” instead of what you posted above and what is mentioned in the thread you referenced. What I had was close to correct - I just added the “org.” and the “.core.items.” parts in error, trying to match the formatting of the other entries I guess, and thus accomplished nothing even though I had relatively blindly stumbled on roughly the correct sequence of steps.

Thanks again for the help and understanding, it has been a learning experience.

1 Like