git clone https://github.com/diegohce/elasticlogger.git ~/go/src/elasticlogger
cd ~/go/src/elasticlogger
makecd ~/go/src/elasticlogger
docker plugin create <registry>/elasticlogger:<tag> ./plugin-dir
docker plugin push <registry>/elasticlogger:<tag>Make sure there's no previous elasticlogger installation from build process.
docker plugin lsIf 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>docker plugin set elasticlogger:latest HOST=http[s]://<elastic_host:port>
docker plugin enable elasticlogger:latest| Option | Description |
|---|---|
| HOST | Elasticsearch server http[s]://host:port |
| 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 |
docker run --log-driver elasticlogger --log-opt index=myappindex ...| 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 |