Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diegohce/elasticlogger

Docker log driver for elasticsearch logging
https://github.com/diegohce/elasticlogger

docker docker-logging docker-logs docker-plugin elasticsearch go golang log logging logs plugin

Last synced: 20 days ago
JSON representation

Docker log driver for elasticsearch logging

Awesome Lists containing this project

README

        

[![Go Report Card](https://goreportcard.com/badge/github.com/diegohce/elasticlogger)](https://goreportcard.com/report/github.com/diegohce/elasticlogger)
[![Actions Status](https://github.com/diegohce/elasticlogger/workflows/Build/badge.svg)](https://github.com/diegohce/elasticlogger/actions)
[![Actions Status](https://github.com/diegohce/elasticlogger/workflows/Test/badge.svg)](https://github.com/diegohce/elasticlogger/actions)
[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/diegohce/elasticlogger/blob/master/LICENSE)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/diegohce/elasticlogger/graphs/commit-activity)
[![HitCount](http://hits.dwyl.io/diegohce/elasticlogger.svg)](http://hits.dwyl.io/diegohce/elasticlogger)

# elasticlogger

# Build & install from source

```bash
git clone https://github.com/diegohce/elasticlogger.git ~/go/src/elasticlogger
cd ~/go/src/elasticlogger
make
```
## Pushing to registry

```bash
cd ~/go/src/elasticlogger
docker plugin create /elasticlogger: ./plugin-dir
docker plugin push /elasticlogger:
```
## Installing from regisrtry
Make sure there's no previous elasticlogger installation from build process.
```bash
docker plugin ls
```
If there's any, remove them first.
```bash
docker plugin rm :
```
Now, we can install `elasticlogger` from registry.
```bash
docker plugin install --alias elasticlogger /elasticlogger:
```
Optionally, you can set the `HOST` value at the same time.
```bash
docker plugin install --alias elasticlogger /elasticlogger: HOST=
```

# Configuration

```bash
docker plugin set elasticlogger:latest HOST=http[s]://
docker plugin enable elasticlogger:latest
```
## Mandatory plugin settings

Option
Description

HOST
Elasticsearch server http[s]://host:port

## Optional plugin settings

Option
Description
Default

GCTIMER
sets the garbage collector interval
1m

LOG_LEVEL
sets the loglevel for the driver's own log entries
info

USER
User for basic auth
 

PASSWORD
PASSWORD for basic auth
 

DATESUFFIX
Date suffix pattern to append to index name. See Go time package
200601

bulksize
sets how many lines of log to send at a time
10

# Usage

```bash
docker run --log-driver elasticlogger --log-opt index=myappindex ...
```

## Container level settings

Option
Description
Default

index
Elasticsearch index where logs will be stored
No default. Mandatory setting.

host
will override driver host
plugin's HOST value

bulksize
sets how many lines of log to send at a time
10

USER
User for basic auth
 

PASSWORD
PASSWORD for basic auth