Honor stderrthreshold when logtostderr is enabled#428
Open
pierluigilenoci wants to merge 1 commit intokubernetes-sigs:masterfrom
Open
Honor stderrthreshold when logtostderr is enabled#428pierluigilenoci wants to merge 1 commit intokubernetes-sigs:masterfrom
pierluigilenoci wants to merge 1 commit intokubernetes-sigs: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>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pierluigilenoci The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
legacy_stderr_threshold_behavior=falseafterflag.Set("logtostderr", ...)inhack/smoketest.goto opt into the corrected behaviorstderrthreshold=INFOas default to preserve current behavior (all logs still go to stderr)-stderrthreshold=WARNINGor-stderrthreshold=ERROR