/docker_log_driver_loki

A Docker log driver for Grafana Loki

Primary LanguageGoGNU Lesser General Public License v3.0LGPL-3.0

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