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

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.56%. Comparing base (6cabecb) to head (665a57e).

Files with missing lines Patch % Lines
pkg/appsec/coraza_logger.go 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3801      +/-   ##
==========================================
- Coverage   61.60%   61.56%   -0.05%     
==========================================
  Files         405      405              
  Lines       41569    41579      +10     
==========================================
- Hits        25610    25598      -12     
- Misses      13850    13866      +16     
- Partials     2109     2115       +6     
Flag Coverage Δ
bats 45.41% <95.23%> (-0.08%) ⬇️
unit-linux 34.51% <95.23%> (-0.01%) ⬇️
unit-windows 24.33% <0.00%> (-0.03%) ⬇️

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.

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.

1 participant