Docker GELF驱动程序env选项 [英] Docker GELF driver env option
问题描述
获得 - log-opt env = env1,env2
选项与Docker 1.12群组模式和灰色日志一起使用的问题。我的所有日志正在发送,标签正在通过。但是,从 env
设置中,根本看不出什么。我也尝试使用 - log-opt labels = dev
但有同样的问题。
Having an issue getting the --log-opt env=env1,env2
option to work with docker 1.12 swarm-mode and graylog. All of my logs are being sent fine and the tag is coming through. However I see nothing coming in at all from the env
setting. I also tried using --log-opt labels=dev
but had the same issue.
他们正在运送到graylog,我没有看到任何通过的任何日志字段。任何关于我在这里做错的想法?
They are being shipped to graylog and I'm not seeing it anywhere within any of the log fields that come through. Any ideas on what I'm doing wrong here?
docker service create --log-driver = gelf --log-opt gelf-address = udp:// logserver:12201 --log-opt tag =app-name--log-opt env = dev ...
推荐答案
我有同样的问题,在这里回答: https://stackoverflow.com / a / 40182515/701260
I had the same issue and answered it here: https://stackoverflow.com/a/40182515/701260
当您使用 - log-opt env = dev
它将从环境检索变量 dev
,并将其包括在事件中。
When you use --log-opt env=dev
, it will retrieve the variable dev
from environment and include it in the event eg. dev: <val-from-env
.
标签与docker标签一样。
Labels do the same with docker labels.
这篇关于Docker GELF驱动程序env选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!