Complete the command to run a Docker container with the default logging driver.
docker run --log-driver=[1] nginxThe default Docker logging driver is json-file, which stores logs as JSON on the local disk.
Complete the command to run a Docker container using the syslog logging driver.
docker run --log-driver=[1] alpine echo helloThe syslog logging driver sends container logs to the syslog daemon on the host.
Fix the error in the command to disable logging for a container.
docker run --log-driver=[1] busybox echo testSetting the logging driver to none disables logging for the container.
Fill both blanks to configure a container to use the fluentd logging driver with a custom address.
docker run --log-driver=[1] --log-opt [2]=192.168.1.100:24224 alpine echo hi
The fluentd logging driver sends logs to a Fluentd collector. The option fluentd-address sets the collector's address.
Fill all three blanks to create a Docker daemon configuration file snippet that sets the default logging driver to json-file with max size 10m and max files 3.
{
"log-driver": "[1]",
"log-opts": {
"max-size": "[2]",
"max-file": "[3]"
}
}This JSON config sets the Docker daemon to use json-file as the default logging driver, limits log file size to 10m, and keeps 3 rotated files.