qdm12 / dns

Docker DNS server on steroids to access DNS-over-TLS from Cloudflare, Google, Quad9, Quadrant or CleanBrowsing
https://hub.docker.com/r/qmcgaw/cloudflare-dns-server
MIT License
231 stars 38 forks source link

How to export unbound logging to docker host? #78

Closed nfour14 closed 3 years ago

nfour14 commented 3 years ago

Has anyone successfully been able to get the unbound logging (both unbound and queries) to be written on the docker host? I am using a bind mount to pass includes.conf, but its telling me the log location I specified in includes throw a permission denied.

qdm12 commented 3 years ago

It runs as user 1000 so if you bind mount a file or directory, you need to chown 1000 yourdir on your host before bind mounting it.

Apart from that, you could also just raise the verbosity of Unbound using the environment variable available. The Docker logs are written to /var/logs/docker if I remember correctly.

Ultimately you could have promtail + Loki + grafana setup but that's a bit far away from the original issue!

Also note there is that v2.0.0-beta image available which is working fine and has logging available (see the readme on the v2.0.0 github branch). It's still a work in progress but it should offer a lot more including Prometheus metrics and structured logs.