Can a Rule watch the logs

Someone was working on a binding to do this at some point. I don’t know what state it made it to.

There was also a long thread where this was discussed but I can’t find it any longer. Perhaps if you spend more than two minutes searching for it you can find it as well.

There really isn’t a way to do this from Rules. You will need something external to tail the log and filter based on whatever criteria you want and publish those lines to OH using OH’s REST API or MQTT.

However, from what you are describing, you probably only need to configure the logging to put those log statements in separate files in the first place. See Log4j2 Sample Config

You can put logs from separate bindings down to logs from individual Rules into separate files through the config.

1 Like