I am aware how to find out the current default logging driver for the Docker engine, but according to the docs:
Changing the default logging driver or logging driver options in the daemon configuration only affects containers that are created after the configuration is changed. Existing containers retain the logging driver options that were used when they were created.
Is there a way of querying the running container in swarm to see which logging driver it is using? I have tried digging through what docker inspect
is giving me for a given running container but can’t see it listed anywhere.
Edit: These are deployed via docker compose into a Docker Swarm.
2
Answers
That’s, odd it is right ther:
Yes, you can query a running container to see which logging driver it is using. The information about the logging driver is available in the container’s metadata. You can use the docker inspect command with a specific format option to extract the logging driver information.
docker inspect -f ‘{{.HostConfig.LogConfig.Type}}’ <container_id>