DCA · Question #138
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 <container-id>
The correct answer is B. No. The docker logs command retrieves existing logs from a container's configured logging driver for display, but it does not configure the container to export logs to an external solution.
Question
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 <container-id>
Options
- AYes
- BNo
How the community answered
(29 responses)- A7% (2)
- B93% (27)
Why each option
The `docker logs` command retrieves existing logs from a container's configured logging driver for display, but it does not configure the container to export logs to an external solution.
This command only serves to view existing container logs locally; it provides no mechanism to establish or modify a connection for forwarding logs to an external logging service.
The `docker logs <container-id>` command is used to fetch and display logs that have already been generated by a running container and stored by its configured logging driver. It does not initiate or configure the export of these logs to an external centralized logging solution such as Splunk.
Concept tested: Docker log retrieval vs. logging driver configuration
Source: https://docs.docker.com/engine/reference/commandline/logs/
Topics
Community Discussion
No community discussion yet for this question.