DCA practice question 22 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: Set the log-driver and log-oPt keys to values for the logging solution (Splunk) In the daemon.json file.
Full set: 191 questionsThe daemon.json file is the standard method for configuring the Docker daemon's default settings. By setting the log-driver key, you define the default logging driver for all new containers started by that daemon. The log-opts key is used to pass specific configuration options required by that driver, such as the token and URL for a Splunk collector. This approach centralizes the logging configuration at the host level, ensuring all containers automatically forward their logs to the specified external system without needing individual configuration.
B: This is incorrect. Configuring the daemon.json file is the primary and officially documented method for setting a default logging driver for all containers on a Docker host.
1. Docker Docs, "Configure logging drivers", Daemon configuration file section. The documentation explicitly states: "To configure the Docker daemon to default to a specific logging driver, set the value of log-driver to the name of the logging driver in the daemon.json file."
2. Docker Docs, "Splunk logging driver". This page details the specific log-opts available for the Splunk driver, such as splunk-token and splunk-url, which are configured in the daemon.json file.
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…
