# Grafana logging

in order to feed docker logs, which is kind of a big deal in this use case, we need to go through a few steps.
By default, setting up grafana, loki and promtail, we will be able to see the `/var/log/` files on the host machine.

Very nice & convienient, but we really want the docker logs as well.


## Install the plugin

First installing the docker plugin for the loki driver.

```bash
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
```

After which you may need to restart the docker service.

```bash
sudo systemctl restart docker.service
```

Check if the plugin is installed.

```bash
docker plugin ls
```

We can then add the log pushing on a per container basis, by adding the follwing to each docker-compose.yml file.

```yaml
logging:
    driver: loki
    options:
    loki-url: "http://localhost:3100/loki/api/v1/push"
```
