Log-driver support

Hello,

We’re running Drone on docker on VM’s and trying to configure an alternate log-driver - in this case splunk - but the spawned pipeline containers still use the json-file driver.

I’m not sure if this is supported, but we configured the docker daemon config to use the splunk log-driver as follows:
{
“log-driver”: “splunk”,
“log-opts”: {
“splunk-token”: “XXXXXXXXXXXXXXXXXXX”,
…etc…
}
}

This works for the droner-runner-docker container - which uses the splunk log-driver - and we can see the runner logs in splunk, but not our pipeline containers - which still use json-file driver. I’m guessing that json-file is getting overriden by drone when it creates pipeline containers. Presumably, this is so that drone can parse the output for the UI - but that’s just a guess.

It didn’t appear that using DRONE_DOCKER_CONFIG to mount and pass this configuration was an option either.

Is this correct? Is there an alternate configuration method here that I missed?

at this time, only the json-file log driver is supported, which is what Drone uses to extract and stream logs in the user interface. The docker community engine does not support streaming logs with custom drivers, which is problematic for Drone.

When using Docker Community Engine, the docker logs command is only available on the following drivers:

  • local
  • json-file
  • journald

Makes sense. Thanks for the prompt reply!

@bradrydzewski it seems this information (and the docker docs) are incorrect - look at this merge, the logging options were merged from Docker-EE - https://github.com/moby/moby/pull/40543

Here’s a comment where docker guys are discussing that the documentation is incorrect and should be updated - moby/PR-40543 comment

I can confirm that we’re using Docker CE 20 with awslogs, and docker logs command still works.
Would you guys reconsider making the pipeline containers log options configurable?
Preferably with some sort of templating, so we could set template names for log streams in aws logs?

output of docker version below:

Client: Docker Engine - Community
 Version:           20.10.0

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0

output of docker inspect

docker inspect through-cache | grep log
                "Type": "awslogs",
                    "awslogs-group": "/aws/droneci/master",
                    "awslogs-region": "ap-southeast-2",
                    "awslogs-stream": "drone-through-cache"

output of docker logs shows actual logs :slight_smile:

1 Like