Exclusion of single item from logging in events.log

Hi there,

sorry for posting this banal question, but I cannot find an answer by myself …

How can I exclude a single item from logging into events.log?

Example: item “Lokale_Zeit”

2020-07-02 10:01:48.834 [vent.ItemStateChangedEvent] - Lokale_Zeit changed from 2020-07-02T10:01:18.813+0200 to 2020-07-02T10:01:48.817+0200

These entries are simply littering my events.log file.

Thanks in advance!

My first inclination is “so what?” events.log is the log of all the events on the Event Bus. It’s supposed to reflect what your openHAB system is doing. Redacting events.log damages it’s very purpose. Instead, I like to recommend How to watch and look through logging instead to filter all your logs to only see those lines that are relevant to what you are actively working on at that time.

But, if you must, openHAB - Filtering event logs shows how to configure the log to exclude lines that match a given regular expression.

I filter my logs too. See this configuration:

log4j2.appender.event.filter.regex.type = RegexFilter
log4j2.appender.event.filter.regex.regex = .*(Latenz|Musik_Spotify_Fortschritt|System|nanoleaf:controller|unsend|Sequence|bridgeV6|predicted|Gruppe|activityStarted|activityStarting|Astro|RPi2Helper|buttonevent).*
log4j2.appender.event.filter.regex.onMatch = DENY
log4j2.appender.event.filter.regex.onMisMatch = ACCEPT

I added this to /srv/openhab2-userdata/etc/org.ops4j.pax.logging.cfg

Hint: for testing purposes and/or fast access to the file you can create a symlink to the file into your openhab config folder:


So you can change settings easily any time without opening an ssh session

If you want to make your log look even nicer check out this thread.

2 Likes

Thank you @rlkoshak and @Felix_Schneider for commenting and your explanations and hints!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.