On Ubuntu 24.04 Noble,
--log-driver="json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs|none"
Logging driver for the container. Default is defined by daemon --log-driver flag.
Warning: the docker logs command works only for the json-file and
journald logging drivers.
The default json-file
logging driver is inefficient and does not enable log rotation by default.
Docker 18.09 introduced a new local
logging driver. While it does not appear in docker-run(1)
from Ubuntu’s docker.io package, docker logs
works just fine in the following test. It’s likely just an error in the man page.
sudo docker logs -f "$(sudo docker run -d --log-driver=local --rm alpine:latest sh -c 'echo a;
sleep 10; echo b')"