Debugging Rules with Karaf


One of my rules is not having the expected result and I’d like to be able to monitor the debugging for this rule but am unsure how to get Karaf to log rules as I was able to see in the console when running from OH1. Please bear in mind I’m SSHing into a headless machine which is running OH2.

tail -f /var/log/openhab2/openhab.log -f /var/log/openhab2/events.log

Are these the droids you’re looking for?

Or these droids over here: :wink:

These are not the droids I’m looking for- move along!

But those don’t quite do what I had in mind as they just don’t seem to log what I’m after! In OH1 on the debug runtime, it would display errors when trying to execute rules, update when the state of an item had changed and inform what messages were sent out via serial, for example.

In OH 1 everything that was written to the console was a combination of openhab.log and events.log. So @ThomDietrich’s command should give you the same information as you used to get. What is missing?

I agree with @rlkoshak. Is the missing piece perhaps the logging of noteworthy steps in your rule, which you still have to add yourself!?

var String speedtestCliOutput = executeCommandLine("/usr/local/bin/speedtest-cli@@--simple", 120*1000)
logInfo("RULE", "--> speedtest output:\n" + speedtestCliOutput + "\n\n")