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>
Correct Answer: B
= The command docker logs <container-id> will not configure a Docker container to export container logs to the logging solution, such as Splunk. This command only displays the logs of a specific container in the standard output or a file, but does not send them to any external system1. To export container logs to Splunk, you need to use the Docker Logger Drivers, which are plugins that provide logging capabilities for Docker containers2. The Splunk logging driver sends container logs to HTTP Event Collector in Splunk Enterprise and Splunk Cloud3. To use the Splunk logging driver for a specific container, you need to use the command-line flags --log-driver and --log-opt with docker run, and provide the Splunk token and URL as options3. For example:
$ docker run --log-driver=splunk --log-opt splunk-token=VALUE --log-opt splunk-url=VALUE ...
:
docker logs | Docker Documentation
Logging drivers | Docker Documentation
Splunk logging driver | Docker Documentation