chore: reduce verbose logging for successful token validation#1763
chore: reduce verbose logging for successful token validation#1763olebhansen wants to merge 1 commit intoAltinn:mainfrom
Conversation
Change LogInformation to LogDebug for "Successfully validated the token." message. This log entry is generated for every authenticated request and contributes to excessive log volume in production environments. Related to: Altinn/altinn-notifications#1215 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdjusted logging verbosity in JWT token validation by changing the success message log level from Information to Debug. No modifications to authentication logic or error handling; only the output verbosity is affected. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR changes the log level for "Successfully validated the token." message from
LogInformationtoLogDebug.Background
As part of work to reduce excessive logging in Altinn Notifications (see altinn-notifications#1215), we identified that the Notifications services were generating millions of log entries. The main changes were made in:
After deploying those changes, we observed that the "Successfully validated the token." message is still being logged at high volume. This message is logged for every successfully authenticated request, which generates significant log volume in production.
Rationale
Informationlevel for every successful token validationDebuglevel so it's available when needed but doesn't flood production logsLogging successful validations at
Informationlevel is unusual - typically only failures or warnings warrant this level. The authentication failure paths already log appropriately atInformationlevel, which is more useful for troubleshooting.Changes
JwtCookieHandler.cs: ChangedLogInformationtoLogDebugfor "Successfully validated the token." message (line 225)Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.