I’m new to OH2 (and OH for that matter) and I’m developing a new binding. For some reason, logging does not seem to work for me. Here’s how I create a logger in my thing handler:
With xyz being the name of my bundle (sorry for the secrecy - can’t reveal at this time as the company I’m working for has not signed off on me publishing this). I can confirm that the code with the log statement is actually called (System.out.println("…") next to the log statement IS producing output.
I hope you mean userdata/logs/openhab.log.
But you are right, the log:set command does not influence the logging level of that file - they stick to what is defined in here.
Usually for debugging you simply stay in the console. If you do a log:tail or log:display you should see all your info and debug messages.
Thanks for the lighting fast response, Kai. That worked like a charm.
One followup question, though. I accidentally used a wrong case when I set the log level for the bundle (org.openhab.binding.Xyz instead of org.openhab.binding.xyz). Overwriting the existing, wrong log level entry with the correctly cased version doesn’t work for some reason (it is apparently ignored). As a result, I still can’t log anything for that particular package other than the default log level. Do you know how to reset log level settings? If it’s too complicated, I can always create a clean new instance (and pay for my mistake ;-))