Grafana on docker: not able to find log

I am using Grafana on docker. I can connect to the main UI. However I have some problems to establish a connection to a backend and that's why I would like to look at the logs.

According to the Docker file, they should be located at /var/log/grafana/ . However this directory is empty. What am I missing ?

Thanks !


Solution 1:

I know this question has been dead for 15 months by now, but since it is the first result coming up when searching for grafana docker logs:

Grafana's logging mode in its default configuration is set to console. You can change that by setting the environment variable GF_LOG_MODE to console file if you want the logs to be written to both, the console and a file. Set it to file otherwise. This works for docker-compose.yml, docker run or can be set at a later point of time from within the grafana-container by editing its grafana.ini

Edit: You might have to set the environment variable GF_LOG_LEVEL in addition to GF_LOG_MODE as your container might crash otherwise: GF_LOG_LEVEL=info

The different log-modes to chose from can be found in Grafana's precise documentation