Skip to main content
  1. Tags/

Aspect-Oriented-Programming

Implementing Activity Logging with Custom Attributes

Deep Dive .NET · Dec 1, 2024 · 6 min read
The first version of audit logging in the Contact Management Application was what most codebases end up with: _logger.LogInformation("Creating contact...") copy-pasted into every controller action. It worked, until someone forgot one, and the one they forgot was of course the action the auditors asked about. Logging that depends on developer discipline isn’t an audit trail; it’s a suggestion.
Implementing Activity Logging with Custom Attributes