nerdexam
Docker

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.

Submitted by ashley.k· Apr 18, 2026Installation and Configuration

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)
  • A
    73% (38)
  • B
    15% (8)
  • C
    8% (4)
  • D
    4% (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`.

ASet the value of log-driver to the name of the logging driver In the daemon.json In /etc/docCorrect

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.

BUse the -log-driver' flag when you run a container.

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.

CAt the command line, type: docker log driver set <driver name>

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.

DInstall a logging agent on the Linux host.

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

#Logging#Logging Agents#Log Collection#Host Configuration

Community Discussion

No community discussion yet for this question.

Full DCA Practice