linkerd / linkerd2

Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.
https://linkerd.io
Apache License 2.0
10.58k stars 1.27k forks source link

Setting `-log-level debug` introduces `client-go` logging at the `INFO` level #12887

Open siggy opened 1 month ago

siggy commented 1 month ago

What is the issue?

Setting -log-level debug on the various Go Control Plane components enables more-detailed client-go logging, which is good, except those log lines are printed at the INFO level.

How can it be reproduced?

$ HOSTNAME=foo bin/go-run controller/cmd destination
INFO[2024-07-25T18:17:47Z] running version edge-24.4.5
INFO[2024-07-25T18:17:47Z] starting admin server on :9996
...
INFO[2024-07-25T18:17:50Z] caches synced

$ HOSTNAME=foo bin/go-run controller/cmd destination --log-level debug
INFO[2024-07-25T18:18:21Z] running version edge-24.4.5
INFO[2024-07-25T18:18:21Z] starting admin server on :9996
...
INFO[2024-07-25T18:18:22Z] GET [https://example.com:443/apis/discovery.k8s.io/v1](https://example.com/apis/discovery.k8s.io/v1) 200 OK in 246 milliseconds
INFO[2024-07-25T18:18:30Z] caches synced

Logs, error output, etc

see above

output of linkerd check -o short

n/a

Environment

edge-24.4.5

Possible solution

client-go logs should show up at the DEBUG level. more generally: setting -log-level debug should introduce DEBUG log lines, not more INFO lines.

Additional context

No response

Would you like to work on fixing this bug?

maybe

alpeb commented 1 month ago

The issue stems from us passing logrus' standard logger to klog, which uses an InfoLevel by default. We could easily change that level to Debug, and have all client-go log entries show as debug in the output.