https://github.com/lfdominguez/docker_log_driver_loki
A Docker log driver for Grafana Loki
https://github.com/lfdominguez/docker_log_driver_loki
docker driver grafana logs loki
Last synced: 6 months ago
JSON representation
A Docker log driver for Grafana Loki
- Host: GitHub
- URL: https://github.com/lfdominguez/docker_log_driver_loki
- Owner: lfdominguez
- License: lgpl-3.0
- Archived: true
- Created: 2019-02-13T17:05:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T18:10:37.000Z (about 6 years ago)
- Last Synced: 2024-11-15T21:51:58.739Z (8 months ago)
- Topics: docker, driver, grafana, logs, loki
- Language: Go
- Size: 51.8 KB
- Stars: 18
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Grafana Loki log driver for Docker
[](https://travis-ci.com/lfdominguez/docker_log_driver_loki)
[](https://github.com/lfdominguez/docker_log_driver_loki/releases)



[](https://goreportcard.com/report/github.com/lfdominguez/docker_log_driver_loki)
[](https://codeclimate.com/github/lfdominguez/docker_log_driver_loki/maintainability)This project allow to send all Docker Logs to Grafana Loki Server.
## Build
### From source
Clone from *GitHub*:
```sh
git clone https://github.com/lfdominguez/docker_log_driver_loki
```and then use the *Makefile*:
```sh
make
```### From releases
Download:
* [Latest release](https://github.com/lfdominguez/docker_log_driver_loki/releases)
* [Plugin config file `config.json`](https://raw.githubusercontent.com/lfdominguez/docker_log_driver_loki/master/config.json).Create the *rootfs* of the plugin and copy the release and config file
```sh
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
```sh
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:
```sh
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
```