Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

docker logs fails because the logging driver cannot be read back

Errorconfigured logging driver does not support reading

Short answer

docker logs can only read from a driver that stores logs locally. Remote drivers such as splunk normally work with docker logs because Docker keeps a local copy through dual logging. The error comes back when that cache is switched off with cache-disabled, or when the driver is none.

  • Applies to Docker Engine 28, Linux, daemon.json
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find which driver and options the container really uses, and read the daemon settings next to it.

    docker inspect my-app
    cat /etc/docker/daemon.json
  2. 2Match what you see, then jump to its fix

    1. 1daemon.json or the run command has a log-opts entry named cache-disabled set to true, together with a remote driver.The dual-logging cache was disabledFix
    2. 2docker logs prints nothing or fails, and the driver is none.The container uses the none driverFix

What does the error look like?

  • configured logging driver does not support reading
  • Error response from daemon: configured logging driver does not support reading

Cause 1 of 2

The dual-logging cache was disabled

1Check

Docker enables dual logging by itself when the driver cannot be read, using the local driver as a cache. The cache-disabled option turns that off, so docker logs has nothing to read.

grep -n -A6 log-opts /etc/docker/daemon.json

2Fix

Remove cache-disabled, or set it to false, and restart the daemon.

# /etc/docker/daemon.json: delete the line
#   "cache-disabled": "true"
sudo systemctl restart docker

3Verify

Start the container again and read its logs.

docker logs --tail 20 my-app

Confirmed by docs.docker.com

Did this fix it?

Cause 2 of 2

The container uses the none driver

1Check

With the none driver, no logs are available for the container and docker logs returns no output.

grep -n log-driver /etc/docker/daemon.json

2Fix

Choose a driver that can be read, such as local or json-file, for the daemon or for one container.

docker run -d --log-driver local --name my-app my-image
# or set "log-driver": "local" in /etc/docker/daemon.json and restart

3Verify

Read the logs of the new container.

docker logs my-app

Confirmed by docs.docker.com

Did this fix it?

How do I stop it coming back?

  • Keep cache-disabled off unless a remote system is your only log reader and you accept that docker logs will not work.
  • When you change log-driver or log-opts in daemon.json, restart the daemon and check the result with docker logs.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

A dev container port does not open in the browser when Docker runs on a remote host

If your application only accepts calls from localhost, it will reject connections from published ports

Three things usually break it: the app listens only on localhost inside the container, so published ports are rejected; you open the container port instead of the mapped localhost port VS Code shows; or you changed appPort or a Compose ports list and did not rebuild.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.