linkerd2 icon indicating copy to clipboard operation
linkerd2 copied to clipboard

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

Open siggy opened this issue 1 year ago • 1 comments

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

siggy avatar Jul 25 '24 18:07 siggy

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.

alpeb avatar Jul 25 '24 19:07 alpeb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 28 '24 23:10 stale[bot]