A .NET source generator that automatically converts ILogger.Log* calls to high-performance LoggerMessage methods.
AutoLoggerMessage is a .NET source generator that automatically converts traditional ILogger.Log* method calls into high-performance LoggerMessage methods. It solves the problem of manually migrating existing codebases to source-generated logging, providing near-identical performance to hand-written LoggerMessage implementations with minimal effort.
.NET developers working on mid-sized to large projects who want to improve logging performance without extensive refactoring, particularly those using .NET 8 or later.
Developers choose AutoLoggerMessage because it automates the tedious migration to LoggerMessage, delivering up to 90% performance gains with zero allocations, while maintaining backward compatibility and providing clear fallback options for edge cases.
A source generator that automatically migrates your logging calls to the LoggerMessage version
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically migrates ILogger.Log* calls to LoggerMessage patterns, reducing overhead by up to 90% and eliminating allocations, as demonstrated in the benchmark tables.
Uses .NET 8 interceptors to seamlessly redirect logging calls without modifying existing code, maintaining API compatibility and reducing refactoring effort.
Provides clear fallback paths to default ILogger extensions for unsupported scenarios, ensuring no breakage in edge cases, as explained in the 'Is something wrong?' section.
Offers tweakable settings via configuration options to customize the source generation process, detailed in the linked wiki page for flexibility.
Only supports .NET 8 and above due to dependency on interceptors, limiting adoption for projects on older .NET versions or frameworks.
Does not support explicit EventId parameters, more than 6 parameters, or generic arguments, forcing fallbacks to less efficient methods and requiring manual workarounds for complex logs.
Relies on .NET interceptors, a relatively new feature that might be subject to breaking changes or have limited tooling support, introducing potential stability risks.