chore(Logging): add DefaultAntiforgery filter rule#8017
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConfigures logging to suppress messages from the ASP.NET Core DefaultAntiforgery component in the server project's logging configuration. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- If the intent is to suppress
DefaultAntiforgerylogs across all providers, consider moving this override to the rootLogging:LogLevelsection instead of only underLgbFileso behavior is consistent between sinks. - Using the full type name
Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryis very specific; consider targeting the broader categoryMicrosoft.AspNetCore.Antiforgeryif you want to suppress antiforgery logs from related components as well.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If the intent is to suppress `DefaultAntiforgery` logs across all providers, consider moving this override to the root `Logging:LogLevel` section instead of only under `LgbFile` so behavior is consistent between sinks.
- Using the full type name `Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery` is very specific; consider targeting the broader category `Microsoft.AspNetCore.Antiforgery` if you want to suppress antiforgery logs from related components as well.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR addresses noisy Antiforgery-related log output by updating the logging package and adding a category-specific log-level override for the file logger configuration (fixes #8016).
Changes:
- Bump
Longbow.Loggingdependency from10.0.0to10.0.1. - Add a
Logging:LgbFile:LogLevelrule to disable logging forMicrosoft.AspNetCore.Antiforgery.DefaultAntiforgery.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Updates Longbow.Logging to a newer patch version to support/align with the logging change. |
| src/BootstrapBlazor.Server/appsettings.json | Adds a file-logger category filter to suppress DefaultAntiforgery logs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8017 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 766 766
Lines 34123 34123
Branches 4692 4692
=========================================
Hits 34123 34123
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:
|
Link issues
fixes #8016
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhancements: