Im trying to clean up the event logs and have successfully edited the file ‘log4j2.xml’ found in ‘/var/lib/openhab/etc/’ to exclude certain matches.
I would like to distinguish ‘temp_example’ from ‘target_temp_example’ so that ‘target_temp_example’ is included in logs but ‘temp_example’ is not. I did not yet succeed though.
What I have tested.
-
<RegexFilter onMatch="DENY" onMismatch="NEUTRAL" regex=".*(temp_example).*"/>
Result: filters out both ‘temp_example’ and ‘target_temp_example’. -
Adding a ‘^’ in the regex-expression → ‘^temp_example’ should state that string should be started with ‘temp_example’ to match.
<RegexFilter onMatch="DENY" onMismatch="NEUTRAL" regex=".*(^temp_example).*"/>
Result: both ‘target_temp_example’ and ‘temp_example’ is present in the log. -
Using two consecutive filters.
<RegexFilter onMatch="ACCEPT" onMismatch="NEUTRAL" regex=".*(target_).*"/> <RegexFilter onMatch="DENY" onMismatch="NEUTRAL" regex=".*(temp_example).*"/>
Result: only the first filter is active and both ‘target_temp_example’ and ‘temp_example’ is present in the log.
I believe it should be possible and the error is within the syntax. Its not the end of the world if not solved (and it can be solved by renaming or other means), its just a bit frustrating that I cannot get the behavior I want. Any advice appreciated, thanks!