Honor stderrthreshold when logtostderr is enabled#782
Open
pierluigilenoci wants to merge 1 commit intokubenetworks:masterfrom
Open
Honor stderrthreshold when logtostderr is enabled#782pierluigilenoci wants to merge 1 commit intokubenetworks:masterfrom
pierluigilenoci wants to merge 1 commit intokubenetworks:masterfrom
Conversation
Bump k8s.io/klog/v2 to v2.140.0 and opt out of the legacy stderr threshold behavior so that -stderrthreshold is respected even when -logtostderr=true (the default). Set stderrthreshold=INFO to preserve current behavior; users can now override it on the command line. Ref: kubernetes/klog#212, kubernetes/klog#432 Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
Author
|
Hi — friendly ping. Is this PR still on the radar for review? Happy to rebase or make changes if needed. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bump
k8s.io/klog/v2to v2.140.0 and opt out of the legacy stderr threshold behavior so that-stderrthresholdis respected even when-logtostderr=true(the klog v2 default).Why
klog v2 defaults
-logtostderrtotrue, which silently ignores-stderrthreshold. All log levels are unconditionally sent to stderr, making severity-based filtering impossible for log aggregation systems.This was reported in kubernetes/klog#212 and fixed upstream in kubernetes/klog#432.
How
klog.InitFlags(nil)inmain()to register klog flags on the standard flag setlegacy_stderr_threshold_behavior=falseto opt into the corrected behaviorstderrthreshold=INFOas default to preserve current behavior (all logs still go to stderr)-stderrthreshold=WARNINGor-stderrthreshold=ERROR