docker logs fails because the logging driver cannot be read back
configured logging driver does not support readingShort 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.
Fix it fast
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.json2Match what you see, then jump to its fix
What does the error look like?
configured logging driver does not support readingError 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.json2Fix
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 docker3Verify
Start the container again and read its logs.
docker logs --tail 20 my-appConfirmed by docs.docker.com
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.json2Fix
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 restart3Verify
Read the logs of the new container.
docker logs my-appConfirmed by docs.docker.com
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
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fixServers
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