logzio / docker-logging-plugin

This is a docker logging driver plugin to forward docker logs to Logz.io
Apache License 2.0
7 stars 3 forks source link

`logzio-tag` option has no effect #39

Open mahnunchik opened 1 year ago

mahnunchik commented 1 year ago

I've faced with the issue that logzio-tag option has no effect.

docker run --log-driver=logzio/logzio-logging-plugin \
--log-opt logzio-token=TOKEN\
--log-opt logzio-url=URL \
--log-opt logzio-dir-path=./docker_logs \
--log-opt logzio-tag="{{.ImageName}}" \
--name testmongo \
-d \
mongo

The short container ID is still present in the dashboard. I've tested different combination from https://docs.docker.com/config/containers/logging/log_tags/

% docker -v
Docker version 20.10.24, build 297e128

Docker Desktop 4.18.0 (104112)

macOS 13.3.1 on M1
genzj commented 1 month ago

The specified logzio-tag isn't being used. Following code always uses DefaultTemplate to generate the tag.

https://github.com/logzio/docker-logging-plugin/blob/9240855652db811237c065ba48f04b6f9d2fdff7/driver.go#L183