DCA practice question 10 of 25

Your organization has a centralized logging solution, such as Splunk. Will this configure a Docker container to export container logs to the logging solution? Solution.docker logs

Full set: 191 questions
Answer options
A: Yes
B: No Correct answer
Correct Answer:
B. No
Explanation

The docker logs command is used to fetch and display the logs that a container has already generated and that have been captured by its configured logging driver. It is a command for viewing logs, not for configuring how or where logs are sent. To export logs to a centralized solution, one must configure the appropriate logging driver (e.g., splunk, syslog, fluentd) for the container at runtime using the --log-driver flag or by setting a default in the Docker daemon configuration.

Why Incorrect

A. This command retrieves existing logs for inspection. It does not establish or configure a persistent log export stream to an external system.

References

1. Docker Documentation, docker logs command reference. States the command's function is to "Fetch the logs of a container".

2. Docker Documentation, "View logs for a container or service". Details the usage of docker logs and explicitly contrasts it with configuring logging drivers for log management.

3. Docker Documentation, "Configure logging drivers". This page details the correct method for sending container logs to centralized systems, which is distinct from the docker logs command.

Scroll to Top