Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map klog levels to controller log levels #2171

Closed
grampelberg opened this issue Jan 29, 2019 · 3 comments
Closed

Map klog levels to controller log levels #2171

grampelberg opened this issue Jan 29, 2019 · 3 comments
Assignees

Comments

@grampelberg
Copy link
Contributor

What problem are you trying to solve?

Currently, changing --controller-log-level does not change klog's level.

How should the problem be solved?

Map the -v levels of klog to panic, fatal, error, warn, info, debug. Kubernetes documents the log levels.

Perhaps:

  • -v 0 - panic, fatal, error, warn
  • -v 1 - info
  • -v 2 - info
  • -v 3 - debug
  • -v 4 - debug
  • -v 5 - Not sure, maybe we should add a trace level? @siggy found differences between logging at -v 8 even. When does it stop?

Note, along with -v for log levels, klog also uses stderrthreshold. The possible values for that are info, warning, error, fatal. These can also be mapped to the linkerd log levels.

@grampelberg
Copy link
Contributor Author

Should there be something similar here for klog and the cli?

@klingerf
Copy link
Contributor

klingerf commented Jan 29, 2019

The CLI doesn't support log levels, but it does have a --verbose flag, which sets logrus's log level to "debug". I recommend setting klog's log level to something sufficiently high (5?) when the --verbose flag is present, rather than making the klog log level fully configurable.

@grampelberg
Copy link
Contributor Author

I'm a +1 on that!

@siggy siggy added priority/P0 Release Blocker and removed priority/P2 Nice-to-have for Release labels Feb 4, 2019
@siggy siggy assigned siggy and dadjeibaah and unassigned siggy Feb 4, 2019
dadjeibaah pushed a commit that referenced this issue Feb 7, 2019
…2221)

The controller logs innocuous messages when control plane proxies aren't ready to route requests during startup from each control plane component. i.e. tap, public-api and proxy-api. Setting the log level in the control plane to `INFO` would not hide these log messages and would still show up on control plane startup.

This PR modifies `klogs` initial flag set to route innocuous logs to `/dev/null` if the controller log level is set to INFO. If set to debug, we output all loglines to stderr.

Fixes #2171 #2168
Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants