0
0
Dockerdevops~20 mins

Docker logging drivers - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Docker Logging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of Docker container logs with json-file driver
You run a Docker container with the default logging driver (json-file). What will be the output of docker logs mycontainer if the container prints Hello World once and then exits?
Docker
docker run --name mycontainer alpine echo Hello World
docker logs mycontainer
A
Error: No logs available
B
Hello World
C
Container started
Hello World
Container exited
DHello World (with JSON metadata lines)
Attempts:
2 left
💡 Hint
The default json-file driver stores logs in JSON but docker logs shows only the message content.
🧠 Conceptual
intermediate
1:30remaining
Understanding Docker logging driver options
Which Docker logging driver is designed to send container logs directly to the systemd journal?
Ajournald
Bfluentd
Csyslog
Djson-file
Attempts:
2 left
💡 Hint
Systemd journal is a logging system used by many Linux distributions.
Troubleshoot
advanced
2:30remaining
Diagnosing Docker logging driver misconfiguration
You configured a Docker container to use the 'fluentd' logging driver but see no logs in your Fluentd server. Which of the following is the most likely cause?
AThe container logs are too large to send
BThe container is using the default json-file driver instead
CThe Fluentd server is not reachable at the configured address
DDocker does not support the fluentd driver
Attempts:
2 left
💡 Hint
Check network connectivity and configuration between Docker and Fluentd.
🔀 Workflow
advanced
2:30remaining
Configuring Docker container with syslog logging driver
You want to run a Docker container that sends logs to a remote syslog server at 192.168.1.100 on port 514 using UDP. Which command correctly sets this up?
Adocker run --log-driver=json-file --log-opt syslog-address=udp://192.168.1.100:514 alpine echo test
Bdocker run --log-driver=fluentd --log-opt address=udp://192.168.1.100:514 alpine echo test
Cdocker run --log-driver=syslog --log-opt syslog-address=tcp://192.168.1.100:514 alpine echo test
Ddocker run --log-driver=syslog --log-opt syslog-address=udp://192.168.1.100:514 alpine echo test
Attempts:
2 left
💡 Hint
The syslog logging driver uses the option 'syslog-address' with protocol and IP.
Best Practice
expert
3:00remaining
Choosing the best logging driver for high-volume production containers
For a high-volume production environment where you want centralized log management with minimal performance impact on containers, which Docker logging driver is generally recommended?
Afluentd
Bjson-file
Cnone
Dlocal
Attempts:
2 left
💡 Hint
Centralized log management often uses external log collectors.