Pointing log files to fontail in docker environment


I am struggling with migrating from OH2 to 3, the reasons are numerous…

At this stage I want to access logs like I did with OH2 (localhost:9001).
I have OH3.0.1 running in a docker container using the exact template from official openhab on hub.docker.com with external volumes mount.
After some googling, I found out that I have to create a fontail container GitHub - welteki/docker_frontail_openhab: openHAB log viewer
I run the docker command but I must miss the right pointing to the log files in the OH3 container, as the fontial container says no such log files…
How do I need to configure it?

My docker-compose file to run the OH3 container:

version: ‘2.2’

image: “openhab/openhab:3.0.1”
container_name: openhab3
restart: unless-stopped
network_mode: host
- “/etc/localtime:/etc/localtime:ro”
- “/etc/timezone:/etc/timezone:ro”
- “openhab_addons:/openhab/addons”
- “openhab_conf:/openhab/conf”
- “openhab_userdata:/openhab/userdata”
EXTRA_JAVA_OPTS: “-Duser.timezone=Europe/Berlin”
- “traefik.enable=true”
- “traefik.http.routers.openhab3.rule=Host(IP_of_host)”
- “traefik.http.routers.openhab3.entrypoints=web-secure”
- “traefik.http.routers.openhab3.tls=true”
- “traefik.http.routers.openhab3.tls.certresolver=primary”
- “traefik.http.services.openhab3.loadbalancer.server.port=8085”
driver: local
driver: local
driver: local

And here is what the fontail dockerfile is: I tried both and they don’t work


Using docker named volumes

If you did set up your openhab container using docker named volumes you can just mount the userdata volume as demonstrated in the following configuration.

docker run -d \
  --name frontail-openhab \
  -p 9001:9001 \
  -v openhab_userdata:/openhab/userdata:ro \

Mounting log files from host directory

docker run -d \
  --name frontail-openhab \
  -p 9001:9001 \
  -v /opt/openhab/userdata/logs:/var/log/openhab:ro \

Many thanks!

The whole reason that containers exist is isolation. The software running in a container cannot access the network, files, hardware, or anything else on the hose unless you explicitly give it permission to do so.

Frontail needs to have access to openHAB’s log files.

You seems to be doing that OK here for the most part. However, you have to tell Frontail which files to load and display. I don’t see that being configured anywhere. You need to look at the documentation for Frontail (not, Frontail is not part of openHAB, it’s a wholly separate project completely independent from openHA) for how to tell which files to load and show.

thanks for the heads up!
One thing I don’t understand…I had Fontail on my OH2 (openhabian) Why not create a dockerfile with fontail enabled/integrated? It’s the tool I use the most…

I did a quick search on how to configure Fontail, what I found is too complicated…need to dive in deeper…

Because that’s not how containers are supposed to be used. The container should only run the one service, not a whole host of services. Couple that with the fact that Frontail doesn’t have anything to do with openHAB itself it doesn’t really make sense to package it up and present it as our own. But it’s more the fact that putting Frontail into the openHAB container goes against what containers are supposed to be for.

If you want a one stop config where everything is set up for you you need to stick with openHABian and not try to use containers for this. If you want to use containers, it’s going to be your responsibility to set up most of the stuff that openHABian does for you.

Hi @Feu77,

here Frontail custom theme coloring we talk about themes for frontail for openhab, in this thread there is an example docker-compose.yml Frontail custom theme coloring - #12 by Schnuecks that builds and run frontail as a container and parse openhab logfiles.

1 Like

Of course Docker‘s philosophy is one app, one container. I have been using OH2 for some time now and didn‘t know that Fontail is a separate service until today.

I suggest it should be mentioned on Openhab‘s official Docker Hub page. Like: if you want to monitor logs like installed on Openhabian, just create another container with Fontail using this Dockerfile, with this configuration…might save some time for noobs like me :wink:.

I‘ve read your name so many times, crawling through the hundreds of posts to learn how to cope with OH. It‘s not an easy piece of software. I‘m learning every day.
Keep up that great work! :+1:

Wow, thanks for the link…will crawl through it!

Do we then need to mention FireMotD, InfluxDB, Grafana, Gardenia, Amanda and all the other stuff that openHABian sets up too? That’s the challenge. openHABian sets up and uses a whole bunch of third party services and tools. It doesn’t seem reasonable to require the various other ways to install openHAB (Windows, Docker, Synology, apt, yum, manually) to document what they are not. I’ve no doubt it would help some users but I can’t see the maintainers of the various distributions modifying their docs to document all the ways they are different from openHABian.

Though of course, anyone is able to file an issue and even better, submit a PR.

Fontail comes with openhabian. Grafana isn‘t. I just wonder why a key component is not mentioned at all when talking about running OH in a container. Without the auto refresh logs in the web browser I would have abandoned OH long time ago. I consider it a ‚must have‘ feature of OH.
When I‘m fit enough I‘ll consider posting a request. But I still don‘t understand the procedure exactly.

Anyway, thanks for the clarification.

Notice the Log Viewer is listed right there along side the other Optional Components too.

Because it’s not a key component. It’s one among a dozen third party tools that openHABian can set up for you. It just so happens that it’s one that openHABian sets up by default.

Then it’s a good thing that you figured out how to install and configure it. But how important it is to you does not change the fact that it’s not part of openHAB. Other users feel just as strongly about Node-Red integration or HABApp or InfluxDB+Grafana. But that doesn’t make those any more a part of openHAB itself either.

And since it’s not a part of openHAB, how much responsibility do the maintainers of all the various distros of openHAB have to explain what isn’t a part of openHAB?

If you do file issues or PRs this would need to be addressed in a lot of places, Not just the Dockerhub readme. There are the seven installation pages in the docs (openhab-docs repo) that would need to be updated to list all the third party apps that are not installed (not just Frontail, you’d have to list all of them because while they may not be important to you they will be important to someone), the openhab-snap repo, maybe the openhab-distro repo, openhab-windows repo, openhab-docker repo (of course), openhab-syno-spk repo, openhab-linuxpkg repo, and openhab-qnap-qpkg. None of these different ways to install openHAB include Frontail. Only openHABian does.