Complete the code to specify the logging driver in a Docker run command.
docker run --log-driver=[1] nginxThe json-file driver is the default Docker logging driver that stores logs as JSON files on the host.
Complete the Docker Compose service to use the syslog logging driver.
services:
app:
image: myapp
logging:
driver: [1]The syslog driver sends container logs to the syslog daemon on the host or a remote syslog server.
Fix the error in the Docker daemon.json configuration to enable centralized logging with Fluentd.
{
"log-driver": "[1]",
"log-opts": {
"fluentd-address": "localhost:24224"
}
}The fluentd log driver sends logs to a Fluentd collector, which is useful for centralized logging setups.
Fill both blanks to configure Docker Compose to send logs to a remote syslog server with a tag.
services:
web:
image: nginx
logging:
driver: [1]
options:
syslog-address: [2]Using the syslog driver with a udp:// address sends logs to a remote syslog server over UDP.
Fill all three blanks to create a Docker Compose logging config that sends logs to Fluentd with a custom tag.
services:
backend:
image: mybackend
logging:
driver: [1]
options:
fluentd-address: [2]
tag: [3]The fluentd driver sends logs to the Fluentd collector at localhost:24224 with a custom tag backend.logs for filtering.