Collect logs with promtail, store them in Loki, and browse them in Grafana.
Use docker-compose up
to run this example.
Grafana is running on localhost:3000 (default credentials are admin/secret, deep link directly to logs)
Documentation:
Define file patterns to tail in
config.yml
link:promtail/config/config.yml[role=include]
To directly ship container logs to Loki, you can use the Docker logging driver.
Install Loki logging plugin
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
Use the Loki logging driver in a Docker container
link:docker-compose.yml[role=include]