Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

lfdominguez/docker_log_driver_loki

Repository files navigation

Grafana Loki log driver for Docker

Build Status Go Report Card Maintainability

This project allow to send all Docker Logs to Grafana Loki Server.

Build

From source

Clone from GitHub:

git clone https://github.com/lfdominguez/docker_log_driver_loki

and then use the Makefile:

make

From releases

Download:

Create the rootfs of the plugin and copy the release and config file

mkdir -p ./plugin/rootfs
cp config.json ./plugin/
cp docker_log_driver_loki ./plugin/rootfs/

Create plugin

If you build it or downloaded the release

docker plugin disable -f lfdominguez/docker-log-driver-loki
docker plugin rm -f lfdominguez/docker-log-driver-loki
docker plugin create lfdominguez/docker-log-driver-loki ./plugin
docker plugin enable lfdominguez/docker-log-driver-loki

Form DockerHub

TODO

Use

Docker support on command line set the logging driver with --log-driver, the plugin has this options (required):

  • loki-host: Loki host address.
  • loki-port: Loki service port.

can be setted with --log-opt, example:

docker run --rm -it -e LOG_LEVEL=debug --log-driver lfdominguez/docker-log-driver-loki --log-opt loki-host=192.168.120.159 --log-opt loki-port=80 hello-world