Error response from daemon: configured logging driver does not support reading
came from docker logs on a container started with --log-driver none.
That container keeps no log, so there is nothing to read. Recreate it without
--log-driver none and docker logs works.
The logging driver is fixed when the container is created; check it with
docker inspect --format "LogConfig={{.HostConfig.LogConfig.Type}}". The recreated
container starts a new log, so lines written before the fix are not in it.
The error
PS> docker run -d --name fix9-run-nolog --log-driver none alpine sh -c "echo hello from Maria Garcia; sleep 300"
06c02f637a9d257d9438df4aa070fcf1c0e33a18c22c7038927c786a9f56ad1f
PS> docker logs fix9-run-nolog
Error response from daemon: configured logging driver does not support reading
Why it happens
docker inspect shows the driver the container was created with:
PS> docker inspect fix9-run-nolog --format "LogConfig={{.HostConfig.LogConfig.Type}}"
LogConfig=none
With none the container's output is thrown away, and docker logs has
nothing to show. Without --log-driver a container gets the engine's default. On this machine
the engine default was local
(docker info --format "default log driver: {{.LoggingDriver}}").
A driver that sends logs elsewhere did not give the error here. A container with
--log-driver syslog pointed at an address where nothing listened still answered
docker logs with its output:
PS> docker run -d --name fix9-run-syslog --log-driver syslog --log-opt syslog-address=udp://127.0.0.1:15905 alpine sh -c "echo hello; sleep 300"
7c88a58637adafbbe2ae842c636771fc3d11e01443787254862148eb6e3bb5dd
PS> docker logs fix9-run-syslog
hello
So on this engine the message pointed at none, not at a driver that ships logs to
another place in general. Nothing listened on the syslog address in the test, and the
container still started and ran. If you meet the error with a different driver, the first
check is the same: read the LogConfig type with docker inspect and
compare it with what you expected.
The fix
Remove the container and create it again without the option (or with a driver of your choice):
PS> docker rm -f -v fix9-run-nolog fix9-run-syslog
fix9-run-nolog
fix9-run-syslog
...
PS> docker run -d --name fix9-run-nolog alpine sh -c "echo hello from Maria Garcia; sleep 300"
e9e53f8c79f7e606710e20bd43b0dc9d5a998cef65ec886ce2e4cf6755c71244
PS> docker logs fix9-run-nolog
hello from Maria Garcia
PS> docker inspect fix9-run-nolog --format "LogConfig={{.HostConfig.LogConfig.Type}}"
LogConfig=local
The new container got the engine's default driver, local, and its output was
readable straight away. If the container comes from a script or a Compose file, remove the
none setting there too, or the next recreate brings the error back.
How it was reproduced
On Windows 11 with Docker Desktop, engine and client 29.9.3, from Windows PowerShell 5.1, with
the cached alpine image. A container started with --log-driver none
gave the error on docker logs; one with the syslog driver did not;
recreating the first without the option let docker logs print its line. The
containers and the sample name are the test's own.
Frequently asked
- Why does docker logs say configured logging driver does not support reading?
- In this test the container was created with --log-driver none, which keeps no log. docker inspect showed LogConfig=none. Recreate the container without that option.
- Can I change the logging driver of an existing container?
- The driver is part of the container's configuration. Here the fix was to remove the container and run it again without --log-driver none, after which docker logs worked.
- Does docker logs work with the syslog driver?
- In this test, yes: a container with --log-driver syslog still printed its output with docker logs on engine 29.9.3.
More decoded errors in the Fixes category, and the daily Docker commands, logs included, in Docker for .NET developers, the daily loop.