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 questionsThe 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.
A. This command retrieves existing logs for inspection. It does not establish or configure a persistent log export stream to an external system.
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.
Keep practicing
Take the free DCA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DCA practice questions
- Question 1Does this command create a swarm service that only listens on port 53 using the UDP proto…
- Question 2Will this command ensure that overlay traffic between service tasks is encrypted? Solutio…
- Question 4Does this describe the role of Control Groups (cgroups) when used with a Docker container…
- Question 5Can this set of commands identify the published port(s) for a container? Solution: docker…
- Question 6Will this command mount the host's '/data' directory to the ubuntu container in read-only…
- Question 7A company's security policy specifies that development and production containers must run…
