[logging] why is the log file named "null.log"

I have to questions about the persistance logging.

  1. Why is the log file called “null.log”?
    Do I have to set a custom filename?

  2. Why is the file located in /usr/share/openhab/logs on my RasPi? (Raspbian Jessie; openhab installed via apt)
    Other persistance files are located in a different location.

I guess there is a wrong variable used somewhere.

I’ve just hit these issues as well.

From: Github docs for logging at the bottom it states that logs end up in OPENHAB_HOME/logs. Raspian’s package init file defines OPENHAB_INST_DIR="/usr/share/openhab". However (on mine at least) no logs directory was created. Despite that the openhab.log on debug described entries as being written to a log file. I spent ages with lsof and file trying to find it. This sorts that out (create a symlink for now if you want to make it appear along with the rest of the persistence directories):

mkdir /usr/share/openhab/logs; chown openhab:openhab /usr/share/openhab/logs

Now the reason why it is called null is because, again in the docs, “The provided aliases define the name of the log file” so you need to add “-> alias” to logging.persist. To be fair, I missed this one for a while. See Github source for persistence logging towards the top it seems to want to use the item name as the logfile name so I have no idea what is really going on! Anyway, set an alias and it works.

Now I’ve just got to find out where to log bugs with Raspian provided packages …