【发布时间】:2017-12-06 10:07:18
【问题描述】:
我正在尝试从正在运行的 docker 容器中获取 docker 日志。我已在 docker compose 中将 splunk 配置为日志记录驱动程序,并且我知道如果无法访问 splunk 服务器,则容器将无法启动。
proxysecurity:
image: test/image
network_mode: host
depends_on:
- zookeeper
ports:
- '8083:8083'
logging:
driver: "splunk"
options:
splunk-url: "http://XX.X2.X3.X1:XXX7/"
splunk-token: "XXXXX5-9CA1-44B8-B9E8-2XXX25"
splunk-format: json
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
environment:
XXXCONNECT: localhost:32181
XXXXXRS: http://localhost:8083
现在,如果容器启动并运行时无法访问 splunk 服务器,是否有任何后备机制可以让 docker 容器在本地登录? 或者有什么方法可以记录到 splunk 以及本地容器内?
【问题讨论】: