fix: honor stderrthreshold when logtostderr is enabled#22785
fix: honor stderrthreshold when logtostderr is enabled#22785pierluigilenoci wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
[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 |
|
Hi @medyagh, @spowelljr, @tstromberg — would you be willing to review? Thank you! |
|
Can one of the admins verify this patch? |
|
/retest |
|
/ok-to-test |
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
|
Friendly follow-up — this PR has been waiting for review for about 15 days. The CI failures appear to be infrastructure flakes (pod scheduling timeouts, job failures unrelated to the code change) — the actual build check ( @medyagh @prezha @ComradeProgrammer — would you be able to take a look when you get a chance? It's a small fix to honor the |
|
/retest |
|
/retest |
1 similar comment
|
/retest |
0fbfd0f to
839f2d3
Compare
|
/retest |
klog v2 defaults -logtostderr to true. When active, -stderrthreshold is silently ignored — all log levels are unconditionally sent to stderr. This makes it impossible for log-aggregation systems to filter by severity. Bump klog from v2.130.1 to v2.140.0, which introduces the -legacy_stderr_threshold_behavior flag. Setting it to false enables the fix. We also set -stderrthreshold=INFO to preserve the current default behavior while allowing users to override it on the command line. Ref: kubernetes/klog#212, kubernetes/klog#432 Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com> Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
839f2d3 to
fa1f665
Compare
|
@pierluigilenoci: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does
Bumps klog from v2.130.1 to v2.140.0 and opts into the fixed
stderrthresholdbehavior so that the-stderrthresholdflag is actually honored even when-logtostderr=true.Problem
klog v2 defaults
-logtostderrtotrue. When active,-stderrthresholdis silently ignored — all log levels (INFO through FATAL) are unconditionally sent to stderr. This makes it impossible for log-aggregation systems to filter by severity.This has been an open issue since 2020: kubernetes/klog#212
Fix
-legacy_stderr_threshold_behaviorflagfalseto enable the fixstderrthreshold=INFOto preserve current default behavior (all logs still go to stderr), while allowing users to override it at runtime with e.g.-stderrthreshold=WARNINGThe two
flag.Set()calls are placed afterklog.InitFlags(nil)and before the test-specific flag overrides.References