DCA · Question #156
How do you change the default logging driver for the docker daemon in Linux?
The correct answer is A. Set the value of log-driver to the name of the logging driver In the daemon.json In /etc/doc. To change the default logging driver for the Docker daemon, you must configure the log-driver setting in the daemon.json file, typically located at /etc/docker/daemon.json.
Question
How do you change the default logging driver for the docker daemon in Linux?
Options
- ASet the value of log-driver to the name of the logging driver In the daemon.json In /etc/doc
- BUse the -log-driver' flag when you run a container.
- CAt the command line, type: docker log driver set <driver name>
- DInstall a logging agent on the Linux host.
How the community answered
(52 responses)- A73% (38)
- B15% (8)
- C8% (4)
- D4% (2)
Why each option
To change the default logging driver for the Docker daemon, you must configure the `log-driver` setting in the `daemon.json` file, typically located at `/etc/docker/daemon.json`.
The `daemon.json` file is the standard configuration file for the Docker daemon in Linux, allowing you to set daemon-wide parameters. To change the default logging driver, you add or modify the `log-driver` key within this JSON file, specifying the desired driver, and then restart the Docker daemon for the changes to take effect.
The `--log-driver` flag is used when running an *individual container* to override the daemon's default logging driver for that specific container, not to change the daemon's global default.
There is no `docker log driver set` command for configuring the daemon's default logging driver; configuration is primarily done via the `daemon.json` file.
Installing a logging agent might be part of a logging *solution*, but it does not directly change the Docker daemon's *default logging driver* configuration.
Concept tested: Docker daemon logging configuration
Source: https://docs.docker.com/config/containers/logging/configure/
Topics
Community Discussion
No community discussion yet for this question.