Start openhab with logs

  • Platform information:
    • openHAB version: docker image with build 1272 openhab-2.3.0-SNAPSHOT.zip

What is the command to start openhab and keep it in foreground to display all logs ?

The command used right now in the docker image is: gosu openhab ./start.sh

Thanks,

Given there are at least two other ways to access the logs, why do you want to do this?

The short answer is you cannot do this with the Docker container without some major modifications to the container.

To be kind of docker compliant. It is quite unexpected not to see the logs when starting a container.
docker logs openhab_container should display logs which is not the case
I understand Dockerfile should be adapted. Can you point me to the two other ways ?
As a workaround I suppose I could create a pipe to stdout for the three files audit.log, events.log, openhab.log

Of all the services I run in Docker I think only one does this. If it is a Docker standard it is one that few images seem to follow. Most services I use log to their own log file which you use volumes to get them out of the container.

You can tail -f the log files, or log into the Karaf console and display the logs from there.

Surprising, as it is all the opposite for me. Every container logs to stdout & stderr if not instruct otherwise (nginx, mosquitto, openvpn, elk, grafana, influxdb …)

Anyway, I found this as a solution:

In /openhab/userdata/etc/org.ops4j.pax.logging.cfg

I added:

log4j2.rootLogger.appenderRefs = out, osgi, console
log4j2.rootLogger.appenderRef.console.ref = STDOUT