In Docker, logging drivers determine how container and service logs are captured, formatted, and stored. By choosing the right logging driver, you can centralize logs, integrate with external systems, and manage log retention efficiently. You can always view a container’s output with:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.

What Is the Default json-file Logging Driver?
Docker’s default logging driver isjson-file. It collects container output and writes it as JSON objects on the host filesystem.
To confirm your daemon’s default driver:
json-file:
Where Are json-file Logs Stored?
By default, log files are stored under/var/lib/docker/containers/<container-id>. Each container directory contains a file named <container-id>-json.log:
Rotating or cleaning up old JSON logs prevents disk exhaustion. Consider using Docker’s
log-opts settings like max-size and max-file.Supported Docker Logging Drivers
Beyondjson-file, Docker integrates with multiple logging backends. Choose the one that matches your infrastructure for centralized log aggregation:
| Driver | Use Case | More Info |
|---|---|---|
| awslogs | Send logs to Amazon CloudWatch Logs | AWS CloudWatch Logs |
| fluentd | Forward logs to a Fluentd collector | Fluentd |
| gcplogs | Ship logs to Google Cloud Logging | Google Cloud Logging |
| gelf | Graylog Extended Log Format | GELF Specs |
| journald | Use systemd’s journald | journald |
| splunk | Forward to Splunk | Splunk Docs |
| syslog | Standard syslog protocol | — |
| local | Fast, built-in local driver | — |
| none | Disable logging (no docker logs) | — |
Using the
none driver disables all logs for the container. Only use this when you intentionally want zero log output.Changing the Daemon’s Default Logging Driver
To set a different default logging driver, modify (or create)/etc/docker/daemon.json:
Overriding the Logging Driver Per Container
You can override the daemon default for individual containers with the--log-driver flag:
--log-opt:
Inspecting a Container’s Logging Configuration
To verify which logging driver a container is using:HostConfig.LogConfig section:
Links and References
- Docker Logging Drivers
- Kubernetes Logging with json-file
- AWS CloudWatch Logs
- Fluentd Official Website
- Google Cloud Logging Overview
- Splunk Container Logging