---
source: https://iinventedlight.com/library/notes/docker-logging-configure.md
title: "Docker logging: choose and configure a logging driver"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache License 2.0 (Docker, Inc.); Apache License 2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Configure logging drivers; Docker, Inc., Configure logging drivers (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-logging-configure"
tags: [docker, logging, json-file, daemon, log-driver]
client: Librarian
sources:
  - id: S1
    title: "Configure logging drivers"
    publisher: Docker, Inc.
    url: https://docs.docker.com/engine/logging/configure/
    accessed: 2026-11-26
    license: "Apache License 2.0"
  - id: S2
    title: "Configure logging drivers (source)"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/logging/configure.md
    accessed: 2026-11-26
    license: "Apache License 2.0"
---
# Docker logging: choose and configure a logging driver
**Answer:** Each Docker daemon has a default logging driver, json-file unless you change it, and the local driver is the better default when you want rotation and less disk use.

## Default drivers

Docker ships several logging mechanisms, called logging drivers, to collect information from running containers and services.

Each daemon has a default driver, and every container uses that default unless you pick a different one.

The default is the json-file driver, which caches container logs as JSON internally.

You can also implement logging driver plugins.

By default no log-rotation is performed, so json-file logs can use a significant amount of disk and even exhaust it.

Docker keeps json-file without rotation as the default for backward compatibility and for cases where Docker is the runtime for Kubernetes.

In other situations the local driver is recommended, because it rotates logs by default and uses a more efficient file format.

## How to configure it

Set log-driver in the daemon.json file to change the daemon default.

Options in log-opts must be provided as strings, so numeric values such as max-file go in quotes.

Existing containers do not pick up the new logging configuration automatically.

docker info reports the current default under Logging Driver.

A container can still pass different options with one or more --log-opt flags.

## See also

- [docker-logging-drivers](https://iinventedlight.com/library/notes/docker-logging-drivers/)
- [docker-logs](https://iinventedlight.com/library/notes/docker-logs/)
- [docker-daemon](https://iinventedlight.com/library/notes/docker-daemon/)

## Claims

- id: C1
  claim: The default logging driver is json-file.
  source: S1
  evidence: "The default logging driver is json-file"

- id: C2
  claim: By default no log-rotation is performed, which can exhaust disk space.
  source: S2
  evidence: "By default, no log-rotation is performed"

- id: C3
  claim: The local logging driver is recommended because it rotates logs by default.
  source: S1
  evidence: "the local logging driver is recommended as it performs log-rotation by default"

## Sources

- [S1] Configure logging drivers. Docker, Inc.. https://docs.docker.com/engine/logging/configure/ . License: Apache License 2.0. Accessed 2026-11-26.

- [S2] Configure logging drivers (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/logging/configure.md . License: Apache License 2.0. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Configure logging drivers; Docker, Inc., Configure logging drivers (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
