Set log format during startup
When running the GitLab Runners Helm chart (v0.82.0) on Kubernetes with the logFormat set to json in the values, I don't get the JSON format until the configuration is merged.
Values:
image:
registry: registry.gitlab.com
image: gitlab-org/gitlab-runner
imagePullPolicy: IfNotPresent
imagePullSecrets:
- name: private-registry
replicas: 1
gitlabUrl: https://gitlab.com/
concurrent: 4
logLevel: info
logFormat: json
runners:
config: ""
configPath: /home/gitlab-runner/config.toml
secret: gitlab-runner-linux
volumeMounts:
- name: gitlab-runner-config
mountPath: /home/gitlab-runner/config.toml
subPath: config.toml
readOnly: true
volumes:
- name: gitlab-runner-config
configMap:
name: gitlab-runner-linux-config
Example log output during the pod's lifetime:
Registration attempt 1 of 30
Runtime platform arch=amd64 os=linux pid=14 revision=bda84871 version=18.5.0
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
Merging configuration from template file "/home/gitlab-runner/config.toml"
Created missing unique system ID system_id=r_2gRk2N9sl4kA
Verifying runner... is valid correlation_id=9ab445b6559024c2-IAD runner=aaaaaaaaa
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
Configuration (with the authentication token) was saved in "/home/gitlab-runner/.gitlab-runner/config.toml"
Runtime platform arch=amd64 os=linux pid=7 revision=bda84871 version=18.5.0
Starting multi-runner from /home/gitlab-runner/.gitlab-runner/config.toml... builds=0 max_builds=0
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
{"builds":0,"level":"info","max_builds":2,"msg":"Usage logger disabled","time":"2025-12-09T11:48:15Z"}
{"builds":0,"level":"info","max_builds":2,"msg":"Configuration loaded","time":"2025-12-09T11:48:15Z"}
This isn't a big problem, but it would be nice to have JSON output for the entire lifetime. Have I missed a setting?
Edited by Chris Forbes