Skip to content

Honor stderrthreshold when logtostderr is enabled#318

Open
pierluigilenoci wants to merge 2 commits intogoogle:masterfrom
pierluigilenoci:fix/honor-stderrthreshold
Open

Honor stderrthreshold when logtostderr is enabled#318
pierluigilenoci wants to merge 2 commits intogoogle:masterfrom
pierluigilenoci:fix/honor-stderrthreshold

Conversation

@pierluigilenoci
Copy link
Copy Markdown

Summary

  • After klog.InitFlags, opt into the fixed stderrthreshold behavior introduced in klog v2.140.0
  • Bump k8s.io/klog/v2 from v2.0.0 to v2.140.0
  • Applied to both cmd/server/main.go and cmd/tester/main.go

Motivation

When logtostderr is enabled (the default), klog historically suppressed the stderrthreshold flag, meaning that WARNING and ERROR messages could not be selectively filtered. klog v2.140.0 introduced new flags (legacy_stderr_threshold_behavior) to opt into the corrected behavior where stderrthreshold is properly honored.

Reference: kubernetes/klog#212

Test plan

  • Verify the application still logs to stderr as expected
  • Confirm stderrthreshold flag can be used to control which severity levels appear on stderr

After calling klog.InitFlags, opt into the fixed stderrthreshold
behavior added in klog v2.140.0 so that severe-enough messages are
still mirrored to stderr when logtostderr is set.

Reference: kubernetes/klog#212
Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 26, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pierluigilenoci
Copy link
Copy Markdown
Author

cc @tstromberg for review

@pierluigilenoci
Copy link
Copy Markdown
Author

@googlebot I signed it.

@joeyparrish joeyparrish requested a review from medyagh March 27, 2026 17:41
@pierluigilenoci
Copy link
Copy Markdown
Author

@googlebot I signed it.

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant