-
Notifications
You must be signed in to change notification settings - Fork 573
fix: Appsec dont switch logger level at runtime #3801
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
base: master
Are you sure you want to change the base?
fix: Appsec dont switch logger level at runtime #3801
Conversation
|
@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3801 +/- ##
==========================================
+ Coverage 63.00% 63.05% +0.05%
==========================================
Files 471 471
Lines 33448 33434 -14
==========================================
+ Hits 21073 21081 +8
+ Misses 10253 10229 -24
- Partials 2122 2124 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Here, can we use pkg/logging.SubLogger() ? |
What changed
pkg/appsec/coraza_logger.go:crzLogEvent.Msg.NewCrzLoggernow clones a per-runnerlogrus.Logger(copies output, formatter, hooks) and fixes it at Trace; emission is gated by our own threshold.WithLevelupdates only the logical threshold (does not mutate the underlying logger).Why
rule_id+SetRuleDebug/GetRuleDebugwithout mutating shared state.Impact
Files
pkg/appsec/coraza_logger.go