RalfKoban / MiKo-Analyzers

Provides analyzers that are based on the .NET Compiler Platform.
MIT License
12 stars 1 forks source link

Use message templates instead of 'string.Format' or interpolated strings for Microsoft Logging #931

Open RalfKoban opened 2 weeks ago

RalfKoban commented 2 weeks ago

When using Microsoft.Extensions.Logging.ILogger to log information, use message templates and structured logging instead of calling string.Format or interpolated strings.

RalfKoban commented 2 weeks ago

See Log message template section, described for ASP .NET Core 8.0: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-8.0#lmt