Challenge - 5 Problems
Docker Logging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2: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
Attempts:
2 left
💡 Hint
The default json-file driver stores logs in JSON but
docker logs shows only the message content.✗ Incorrect
The json-file driver stores logs as JSON internally, but the
docker logs command outputs only the container's stdout/stderr content, so you see just 'Hello World'.🧠 Conceptual
intermediate1:30remaining
Understanding Docker logging driver options
Which Docker logging driver is designed to send container logs directly to the systemd journal?
Attempts:
2 left
💡 Hint
Systemd journal is a logging system used by many Linux distributions.
✗ Incorrect
The 'journald' logging driver sends container logs to the systemd journal, integrating with the system's native logging.
❓ Troubleshoot
advanced2: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?
Attempts:
2 left
💡 Hint
Check network connectivity and configuration between Docker and Fluentd.
✗ Incorrect
If the Fluentd server is unreachable, Docker cannot send logs, causing no logs to appear. The fluentd driver is supported and must be reachable.
🔀 Workflow
advanced2: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?
Attempts:
2 left
💡 Hint
The syslog logging driver uses the option 'syslog-address' with protocol and IP.
✗ Incorrect
Option D correctly uses the syslog driver with UDP protocol and the correct option name. Option D uses TCP instead of UDP. Option D uses the wrong driver. Option D uses json-file driver which ignores syslog options.
✅ Best Practice
expert3: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?
Attempts:
2 left
💡 Hint
Centralized log management often uses external log collectors.
✗ Incorrect
The fluentd driver sends logs to an external collector, reducing local disk usage and enabling centralized management. json-file stores logs locally which can impact disk and performance. none disables logging. local is for local optimized storage but not centralized.