I am trying to consume build logs into our logging infrastructure by configuring our docker runners to use the loki docker driver. Installing that as the system default causes all new containers to log to our loki instance.
But build containers are explicitly created to use the
json-file logger, no matter what.
I can sort-of see why that is a sensible choice, you need to make sure
docker logs works to get the output. But in our case, the json files are still created, and everything will still work as needed.
I’d love to get a patch to allow customization here, but not sure the best approach:
- Don’t set the log config at all, and always use the system default. Easiest, but possibly users would run into problems if they change the host’s driver without knowing the consequences (probably rare).
- Have some runner variable to activate the above as an override to the current behaviour.
- Some kind of config in the step? I’d rather not need that, since our goal is to get all logs in one place.
I’d probably prefer option 1, but I am not sure why this is set in the first place. I imagine there is some historical reason for it.