Repository navigation
Keep audit instance logs out of the authorization audit trail - #6196
Open
johnsimons wants to merge 1 commit into
Open
johnsimons wants to merge 1 commit into
johnsimons wants to merge 1 commit into
Conversation
The audit rule used a prefix pattern (`AuthorizationAuditLog.AuditCategory*`), which also matched the audit instance's own loggers under the `ServiceControl.Audit` namespace (e.g. `AuditPersister`). Those loggers were being routed to the audit target instead of the operational log. Switch to exact-name matching per audit category and split the authorization and message-action audit categories into separate rules, so only genuine audit events are final-routed to the audit target while audit instance diagnostics keep flowing to the operational log with the full layout.
rbev
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The NLog rule for the authorization audit trail matched every logger whose name starts with
ServiceControl.Audit. That prefix is also the namespace of the audit instance, so the rule captured every entry at Info or above that the audit instance writes from its own classes. Those entries lost the operational layout: no timestamp, level, logger name or exception. Outside a container they also went toaudit.jsoninstead oflogfile.txt, mixed in with the ECS documents. Debug and Trace entries were not affected, because the rule starts at Info. The rule came in with #5518 and has shipped since 6.18.0.The audit trail categories,
ServiceControl.AuditandServiceControl.Audit.Messages, now each have a rule that matches the exact name. No logger writes to a name below those two categories, so no audit trail entry moves to the operational log.Before and after
In each run, the logging configuration received two sample authorization decisions and two messages from audit instance classes. This is the
audit.jsonit wrote outside a container.Before, on master:
After, on this branch:
On this branch the two text lines go to
logfile.txtwith the full layout.