OH3 Docker LogLevel

Hello,

I’m running the OH3 release in a Docker container. For debugging reasons I want to change the OH LogLevel. According to the Documentation there are two ways changing the LogLevel.

  1. Console: Unfortenately I don’t know how to access the Karaf Console after having started the Container using Docker-Compose. I found a forum post, but the mentioned binary /openhab/runtime/karaf/bin/client doesn’t exist in the docker Image (openhab/openhab:3.0.0-alpine) I’m using. Is there a way to get to the OH console in a docker based environment?

  2. File: It also should be possible to change the LogLevel via the config files. I extended the java.util.logging.properties with the following lines, but unfortunately it seems that OH still logs on INFO-Level:

org.openhab = DEBUG
org.eclipse.smarthome = DEBUG

What’s the prefered way to change the LogLevel in an Docker environment? Or is there even an environment variables based approach available?

Thanks!

If you have default password you can try below command to login to the Karaf Console in docker:

docker exec -it openhab /openhab/runtime/bin/client -p habopen

1 Like

Great, thanks! That worked.

1 Like

One trick I used is to create an alias for that command: alias openhab-cli=“xxx”. Very useful.

I did the same :slight_smile:
also for showing OH logs and login to influxdb:

alias idb='docker exec -it INFLUXDB_CONTAINER_NAME influx -username USER -password PASSWORD -host localhost -database openhab_db'
alias ohtail='tail -f /path/to/openhab/openhab_userdata/logs/openhab.log /path/to/openhab/openhab_userdata/logs/events.log'