Recall & Review
beginner
What is a Docker logging driver?
A Docker logging driver is a tool that controls how and where Docker container logs are stored or sent. It helps collect logs from containers for monitoring and troubleshooting.
Click to reveal answer
beginner
Name three common Docker logging drivers.
Common Docker logging drivers include: json-file (default), syslog, and journald. Each sends logs to different places or formats.
Click to reveal answer
beginner
How do you set a logging driver for a Docker container?
Use the option --log-driver when running a container, for example: docker run --log-driver=syslog alpine echo hello
Click to reveal answer
beginner
What is the default Docker logging driver and what format does it use?
The default logging driver is json-file. It stores logs as JSON-formatted files on the host machine.
Click to reveal answer
intermediate
Why might you choose the syslog logging driver over the default?
Syslog sends logs to the system's centralized logging service, making it easier to manage logs from many containers in one place.
Click to reveal answer
Which Docker logging driver stores logs as JSON files on the host?
✗ Incorrect
The json-file driver stores container logs as JSON files on the host machine.
How do you specify a logging driver when starting a Docker container?
✗ Incorrect
The --log-driver option is used with docker run to set the logging driver.
Which logging driver sends logs to the system's centralized logging service on Linux?
✗ Incorrect
The journald driver sends logs to systemd's journal service on Linux.
What happens if you set the logging driver to 'none'?
✗ Incorrect
The 'none' logging driver disables log collection for the container.
Why use a logging driver like fluentd?
✗ Incorrect
Fluentd driver sends logs to a centralized collector for easier log management and analysis.
Explain what a Docker logging driver is and why it is important.
Think about how logs help you understand what your container is doing.
You got /3 concepts.
Describe how to change the logging driver for a Docker container and give an example.
Remember the command you use to start containers.
You got /3 concepts.