So I’ve been doing some binding development, and you know, it’s just possible I’ve made a mistake or two. I accidentally introduced a NullPointerException with one of my changes. Surprisingly, I didn’t find anything in openhab.log. I kept waiting for some output or error from the binding to appear, but there was nothing. It seems the error message was written to the OH process’s stderr. My OH is started by systemd so it was captured and I found it with journalctl:
Jan 03 01:47:23 xxx karaf[428443]: Exception in thread "OH-binding-powermax:serial:alarm-reader" java.lang.NullPointerException
Jan 03 01:47:23 xxx karaf[428443]: at org.openhab.binding.powermax.internal.handler.PowermaxBridgeHandler.onNewStateEvent(PowermaxBridgeHandler.java:444)
Jan 03 01:47:23 xxx karaf[428443]: at org.openhab.binding.powermax.internal.message.PowermaxCommManager.onNewMessageEvent(PowermaxCommManager.java:277)
Jan 03 01:47:23 xxx karaf[428443]: at org.openhab.binding.powermax.internal.connector.PowermaxConnector.handleIncomingMessage(PowermaxConnector.java:105)
Jan 03 01:47:23 xxx karaf[428443]: at org.openhab.binding.powermax.internal.connector.PowermaxReaderThread.run(PowermaxReaderThread.java:106)
So my question is: why is this NOT in openhab.log? I’d sort of expect there to be a global exception handler for bindings that logs these exceptions in the same way as other log messages. (This is with OH 3.0.0.)