Skip to content

Conversation

@LaurenceJJones
Copy link
Member

What changed

  • pkg/appsec/coraza_logger.go:

    • Stop toggling logger level in crzLogEvent.Msg.
    • NewCrzLogger now clones a per-runner logrus.Logger (copies output, formatter, hooks) and fixes it at Trace; emission is gated by our own threshold.
    • WithLevel updates only the logical threshold (does not mutate the underlying logger).
    • Preserves original entry fields as default context for all events.
  • Why

    • Avoid race conditions and cross-runner log noise from runtime level changes.
    • Keep per-rule debug behavior via rule_id + SetRuleDebug/GetRuleDebug without mutating shared state.
  • Impact

    • Safer, deterministic logging with the same output/format.
    • Per-rule debug continues to work as before, minus shared-level side effects.
  • Files

    • pkg/appsec/coraza_logger.go

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I 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.

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I 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 LaurenceJJones added this to the Next release milestone Aug 8, 2025
@codecov
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.05%. Comparing base (bf1dd5f) to head (4dbef6a).
⚠️ Report is 3 commits behind head on master.

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     
Flag Coverage Δ
bats 46.57% <100.00%> (+0.20%) ⬆️
unit-linux 35.98% <100.00%> (+0.07%) ⬆️
unit-windows 24.33% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmetc
Copy link
Contributor

mmetc commented Jan 23, 2026

Here, can we use pkg/logging.SubLogger() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants