docker-compose 的默认日志记录驱动程序是什么?

What's the default logging driver for docker-compose?

dockerdocs表示:

To configure the Docker daemon to default to a specific logging driver, set the value of log-driver to the name of the logging driver in the daemon.json file, which is located in /etc/docker/ on Linux hosts or C:\ProgramData\docker\config\ on Windows server hosts. Note that you should create daemon.json file, if the file does not exist. The default logging driver is json-file. ...


但是,为什么?为什么在 CentOS 7 上默认使用 journald?我从不在 docker-compose.yml

中指定 log-driver

看看 /etc/sysconfig/docker

您可能会在选项列表中发现,--log-driver 被设置为 journald:

OPTIONS='... --log-driver=journald ...'

要么删除 --log-driver=journald,它将默认为 json-file,要么选择另一个适合您需要的日志记录驱动程序。

重新加载守护进程并检查问题是否仍然存在:

systemctl daemon-reload && systemctl restart docker