OpenHab event logging more verbose after migrating: Update events logged although no change

After migrating to OpenHab 4 and not changing any log configuration,
I noticed that events.log gets filled up with log entries although there is no real change to the item:

2023-08-22 08:21:38.277 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Hobbyraum_BatteryLevel' updated to 1
2023-08-22 08:21:38.278 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Hobbyraum_BatteryLow' updated to ON
2023-08-22 08:22:00.235 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Hobbyraum_BatteryLevel' updated to 1
2023-08-22 08:22:00.236 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Hobbyraum_BatteryLow' updated to ON

I hadn’t changed any log levels when migrating and log:get shows this:

openhab> log:get openhab.event.ItemStateUpdatedEvent
openhab> log:get
Logger                                             │ Level
ROOT                                               │ WARN
javax.jmdns                                        │ ERROR
javax.mail                                         │ ERROR
openhab.event                                      │ INFO
openhab.event.AddonEvent                           │ ERROR
openhab.event.ChannelDescriptionChangedEvent       │ ERROR
openhab.event.InboxUpdatedEvent                    │ ERROR
openhab.event.ItemAddedEvent                       │ ERROR
openhab.event.ItemChannelLinkAddedEvent            │ ERROR
openhab.event.ItemChannelLinkRemovedEvent          │ ERROR
openhab.event.ItemRemovedEvent                     │ ERROR
openhab.event.ItemStateEvent                       │ ERROR
openhab.event.RuleAddedEvent                       │ ERROR
openhab.event.RuleRemovedEvent                     │ ERROR
openhab.event.RuleStatusInfoEvent                  │ ERROR
openhab.event.StartlevelEvent                      │ ERROR
openhab.event.ThingAddedEvent                      │ ERROR
openhab.event.ThingRemovedEvent                    │ ERROR
openhab.event.ThingStatusInfoEvent                 │ ERROR
openhab.event.ThingUpdatedEvent                    │ ERROR
org.apache.cxf.jaxrs.sse.SseEventSinkImpl          │ ERROR
org.apache.cxf.phase.PhaseInterceptorChain         │ ERROR
org.apache.karaf.jaas.modules.audit                │ INFO
org.apache.karaf.kar.internal.KarServiceImpl       │ ERROR                │ ERROR                     │ OFF
org.apache.sshd                                    │ WARN
org.eclipse.lsp4j                                  │ OFF
org.jupnp                                          │ ERROR
org.openhab                                        │ INFO
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime                  │ OFF
su.litvak.chromecast.api.v2.Channel                │ ERROR

Is there anything I can do about this and reduce the amount of log entries? NB: I’d still like to see any real change of value beeing logged!

May I suggest the change that openhab.event.ItemStateUpdatedEvent events should only be logged at the INFO level when the value has changed and on the DEBUG level otherwise.

(Could this have also been the default behavior of OpenHab 3.4?)

Thanks in advance!

Not really, but anyway: why ? Having that info is good.

Update is an as-important information as is Change, and it would be a fundamental change to adversely affect everybody so … no :slight_smile:

Maybe take a look at this?

1 Like

Thanks Mark,

that helped me to fix it, thanks! - However, to be specific for others with the same problem - here are the detailss what I did manually

 1024 cd /tmp
 1025 wget
 1026 diff /srv/openhab-userdata/etc/log4j2.xml /tmp/log4j2.xml
 1027 cp /srv/openhab-userdata/etc/log4j2.xml /home/openhabian/
 1028 cat /tmp/log4j2.xml > /srv/openhab-userdata/etc/log4j2.xml
 1029 ls -al /srv/openhab-userdata/etc/log4j2.xml /tmp/log4j2.xml
 1030 sudo systemctl restart openhab.service

Result: No more “update” information with no item change at the INFO level!

BTW: Here’s the diff for userdata/etc/log4j2.xml :

# diff /home/openhabian/ /srv/openhab-userdata/etc/log4j2.xml
>               <Logger level="ERROR" name="openhab.event.ItemStateUpdatedEvent"/>
>               <Logger level="ERROR" name="openhab.event.GroupStateUpdatedEvent"/>