[SOLVED] Filtering event logs

Hello,

after updating from 2.3 to 2.4 some logging config files was replaced to new version.

Now i get too much infos in event logfile.
How can i exclude some defined Items from logging events?

For example this logs:

2018-12-21 18:43:50.303 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_2_Watt_Org changed from 3335 to 3296
2018-12-21 18:43:50.339 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_4_Watt_Org changed from 2445 to 2379
2018-12-21 18:43:50.342 [vent.ItemStateChangedEvent] - PowerStrip_3_Port_2_Watt_Org changed from 1009 to 1063
2018-12-21 18:43:50.345 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt_Org changed from 73104 to 72849
2018-12-21 18:43:50.354 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt changed from 73.1 to 72.8
2018-12-21 18:43:50.357 [vent.ItemStateChangedEvent] - PowerStrip_3_Port_2_Watt changed from 1.0 to 1.1
2018-12-21 18:43:54.677 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_2_Watt_Org changed from 3296 to 3272
2018-12-21 18:43:54.695 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_4_Watt_Org changed from 2379 to 2349
2018-12-21 18:43:54.698 [vent.ItemStateChangedEvent] - PowerStrip_3_Port_2_Watt_Org changed from 1063 to 1173
2018-12-21 18:43:54.704 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt_Org changed from 72849 to 73306
2018-12-21 18:43:54.707 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_4_Watt changed from 2.4 to 2.3
2018-12-21 18:43:54.709 [vent.ItemStateChangedEvent] - PowerStrip_3_Port_2_Watt changed from 1.1 to 1.2
2018-12-21 18:43:54.711 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt changed from 72.8 to 73.3
2018-12-21 18:43:58.895 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_2_Watt_Org changed from 3272 to 3214
2018-12-21 18:43:58.916 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_4_Watt_Org changed from 2349 to 2221
2018-12-21 18:43:58.928 [vent.ItemStateChangedEvent] - PowerStrip_3_Port_2_Watt_Org changed from 1173 to 1178
2018-12-21 18:43:58.982 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_2_Watt changed from 3.3 to 3.2
2018-12-21 18:43:58.989 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt_Org changed from 73306 to 72936
2018-12-21 18:43:58.993 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_4_Watt changed from 2.3 to 2.2
2018-12-21 18:43:59.005 [vent.ItemStateChangedEvent] - PowerStrip_1_Port_1_Watt changed from 73.3 to 72.9

See your last topic, or just go from here.:wink:

I’ll include an example pic of a few of my items that I have filtered.

@Webfeger Notice the | used without spaces to separate items if filtering more than one item.

Hope the pic helps.

great thanks !!

I get an error when I implement this related to the .onMisMatch line.

Here’s what I’ve added:

ediehl3 - less flood on the logging

log4j2.appender.event.filter.floodstop.type = RegexFilter
log4j2.appender.event.filter.floodstop.regex = .(astro|System_Pulse|SAC_Keypad|SAC_LastResponse|SAC_Security).
log4j2.appender.event.filter.floodstop.onMatch = DENY
log4j2.appender.event.filter.floodstop.onMisMatch = ACCEPT

Image of this code is attached.

And here’s the error in wrapper.log:

org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : RegexFilter contains an invalid element or attribute “onMismatch” Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger

The rules are ignored, and everything goes into the event.log. If I remove the onMisMatch line, nothing at all goes into the event.log.

I’m using a 2 week old install of openHAB2.