Reloader icon indicating copy to clipboard operation
Reloader copied to clipboard

Startup log not in JSON

Open JenniferMack opened this issue 2 years ago • 3 comments

https://github.com/stakater/Reloader/blob/dfb26d789f3b69864cef97cc8b6e4412d2494219/pkg/kube/client.go#L76

We're seeing

time="2023-09-05T14:14:04Z" level=info msg="Environment: Kubernetes"

in our logs, since it's not JSON, it triggers an error alert. We have the helm chart configured to log JSON, and it works otherwise. We just get this one non-JSON log when reloader restarts.

We're on v1.0.39.

Since this happens early in the startup process, is it possible that LogRus isn't getting passed the JSON formatter this early?

JenniferMack avatar Sep 05 '23 21:09 JenniferMack

did you use the --log-format=json option?

karl-johan-grahn avatar Sep 06 '23 08:09 karl-johan-grahn

We use this in the helm values.yaml file:

reloader:
  logFormat: json

where would --log-format=json go?

JenniferMack avatar Sep 06 '23 16:09 JenniferMack