1. Check the Default Logging Driver
Docker uses thejson-file driver by default, storing container logs as JSON on the host.
The
json-file driver is the standard Docker logging backend. It’s easy to parse and works out of the box.2. Create and Inspect a Test Container
Run an Ubuntu container to see its inherited log configuration:3. Supported Logging Drivers
Docker supports multiple logging backends for different use cases. You can find the full list in the official docs:Configure containers → Logging

| Driver | Use Case |
|---|---|
| json-file | Local JSON logs, simple parsing |
| syslog | Centralized logging to syslog daemon |
| journald | Integration with systemd’s journal |
| fluentd | Forward logs to a Fluentd collector |
| awslogs | Ship logs to Amazon CloudWatch Logs |
| splunk | Send logs to a Splunk HTTP Event Collector (HEC) |
| … | And others (gcplogs, logentries, etc.) |
4. Change the Default Driver to Syslog
To switch the daemon-wide driver tosyslog, edit /etc/docker/daemon.json:
Modifying
daemon.json requires restarting the Docker daemon. Existing containers will continue using their current driver until recreated.- Stop Docker:
- Update
/etc/docker/daemon.json: - Restart Docker:
- Verify:
5. Advanced Logging Options
You can fine-tune log behavior withlog-opts. For example, to limit file size and rotation on json-file:
6. Override the Logging Driver per Container
Even when the daemon default issyslog, you can pick a different driver for a specific container:
7. Conclusion
You’ve learned how to:- Check and view Docker’s default logging driver
- Change the daemon-wide driver in
/etc/docker/daemon.json - Apply advanced options like rotation and size limits
- Override logging drivers for individual containers