"Unkown Item" error possibly solved

I think I’ve finally found a fix for random stack dumps appearing in my openhab.log after timers expire.

It seems to be something to do with the logging settings in logback.xml

If a timer expiry calls a logInfo statement such as in the test rule below, AND if the first string in the logInfo command isn’t defined as a logitem in logback.XML (“Testing” in the example below). it will often, but not always Stack Dump referencing an “Unkown Item” when the timer expires, any log statements before the timer however seem to work without an issue.

rule "a test rule"
when Item SomeItem changed 
then  {
    logInfo("Testing", "Something changed and the Timer has been set for 10 minutes time")
    MyTimer = createTimer(now.plusMinutes(10) [|
    logInfo("Testing", "Something happened that you should know about")
    sendCommand(MyItem, ON)

The fix in this case was to add the following to logback.xml

<logger name="org.openhab.model.script.Testing" level="INFO" additivity="false">
	<appender-ref ref="FILE" />

There is no difference to the log output before or after adding the statement other than the after timer log statement always appearing in openhab.log, rather than when it wants to throw you off the scent
Hope this helps someone!

OH 1 or OH 2?

Openhab v 1.8