skip to Main Content

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


  1. I have tried digging through what docker inspect

    That’s, odd it is right ther:

        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
    
    Login or Signup to reply.
  2. 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>

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search