I am having a bit of a challenge to understand the exact syntax for events.log
in log4j2.xml
I want to filter several item update messages and thought I could use the CompositeFilter as described in the official documentation.
But this doesn’t work:
<!-- Event log appender -->
<RollingRandomAccessFile fileName="${sys:openhab.logdir}/events.log" filePattern="${sys:openhab.logdir}/events.log.%i.gz" name="EVENT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
<Filters>
<RegexFilter regex=".*(Shelly_(.*)_LastUpdate|Shelly_(.*)_Power|Shelly_(.*)_Power_Total|Shelly_(.*)_InternalTemp|Shelly_(.*)_WifiSignal|Shelly_(.*)_Uptime).*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*(Solar_(.*)_Actual).*" onMatch="DENY" onMismatch="NEUTRAL" />
<RegexFilter regex=".*(Astro_(.*)).*" onMatch="DENY" onMismatch="NEUTRAL" />
<RegexFilter regex=".*(Motion_Temp_(.*)).*" onMatch="DENY" onMismatch="NEUTRAL" />
</Filters>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="16 MB"/>
</Policies>
<DefaultRolloverStrategy max="5"/>
</RollingRandomAccessFile>
It looks like only the first regex gets processed. How can I create a set of filters like this?