elasticlogger

command module
v0.0.0-...-cba7fac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

README

Go Report Card Actions Status Actions Status GPLv3 license Maintenance HitCount

elasticlogger

Build & install from source

git clone https://github.com/diegohce/elasticlogger.git ~/go/src/elasticlogger
cd ~/go/src/elasticlogger
make

Pushing to registry

cd ~/go/src/elasticlogger
docker plugin create <registry>/elasticlogger:<tag> ./plugin-dir
docker plugin push <registry>/elasticlogger:<tag>

Installing from regisrtry

Make sure there's no previous elasticlogger installation from build process.

docker plugin ls

If there's any, remove them first.

docker plugin rm <plugin>:<tag>

Now, we can install elasticlogger from registry.

docker plugin install --alias elasticlogger <registry>/elasticlogger:<tag>

Optionally, you can set the HOST value at the same time.

docker plugin install --alias elasticlogger <registry>/elasticlogger:<tag> HOST=<elastichost:port>

Configuration

docker plugin set elasticlogger:latest HOST=http[s]://<elastic_host:port>
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

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  

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL