Alexaka1.Analyzers.StructuredLogging
0.1.0
dotnet add package Alexaka1.Analyzers.StructuredLogging --version 0.1.0
NuGet\Install-Package Alexaka1.Analyzers.StructuredLogging -Version 0.1.0
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging" Version="0.1.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Alexaka1.Analyzers.StructuredLogging" Version="0.1.0" />
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Alexaka1.Analyzers.StructuredLogging --version 0.1.0
#r "nuget: Alexaka1.Analyzers.StructuredLogging, 0.1.0"
#:package Alexaka1.Analyzers.StructuredLogging@0.1.0
#addin nuget:?package=Alexaka1.Analyzers.StructuredLogging&version=0.1.0
#tool nuget:?package=Alexaka1.Analyzers.StructuredLogging&version=0.1.0
Structured Logging Analyzers
Roslyn analyzers and code fixes for structured logging message templates. Supports Serilog, NLog, Microsoft.Extensions.Logging, and ZLogger. ZLogger support covers the 1.x string-template overloads. ZLogger 2.x interpolated-string-handler APIs have no message template and are not analyzed.
This package is analyzer-only. It adds no runtime or compile-time assembly reference to consuming applications. The compile-time Roslyn API floor is 4.8.0 (Visual Studio 2022 17.8 or a newer compiler host). See the IDE/compiler policy.
Install
Use the latest version from NuGet. x.y.z is a placeholder.
<ItemGroup>
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging"
Version="x.y.z"
PrivateAssets="all" />
</ItemGroup>
.NET 10 CLI:
dotnet package add Alexaka1.Analyzers.StructuredLogging
Central package management:
<PackageVersion Include="Alexaka1.Analyzers.StructuredLogging" Version="x.y.z" />
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging" PrivateAssets="all" />
Recommended Microsoft analyzers
This package complements the .NET SDK logging rules. After installing,
add these CA* settings if they are not already configured. Several are
disabled or only suggestions by default.
[*.cs]
dotnet_diagnostic.CA1727.severity = none
dotnet_diagnostic.CA1848.severity = suggestion
dotnet_diagnostic.CA2017.severity = warning
dotnet_diagnostic.CA2023.severity = warning
dotnet_diagnostic.CA2253.severity = suggestion
dotnet_diagnostic.CA2254.severity = warning
Projects targeting .NET Standard or .NET Framework also need
<EnableNETAnalyzers>true</EnableNETAnalyzers>. Overlap with AASL rules
and SYSLIB10xx notes:
microsoft-recommendations.md.
Configuration
[*.cs]
dotnet_diagnostic.AASL0001.severity = warning
dotnet_diagnostic.AASL0002.severity = none
dotnet_code_quality.AASL.property_naming = pascal_case
dotnet_code_quality.AASL.ignored_properties_regex = ^Legacy\.
Naming values: pascal_case (default), camel_case, snake_case,
elastic_naming, semantic_conventions (alias semconv).
Use semantic_conventions for Semantic Conventions names such as
service.name and http.response.status_code. The same options
can be scoped to
AASL0009 or AASL0010 (for example
dotnet_code_quality.AASL0009.property_naming).
A rule-scoped key applies only to that diagnostic and wins when set. The
prefix-level key applies to each rule that has no valid rule-scoped value.
Invalid values are ignored and fall through to the next level.
Diagnostics
| ID | Description |
|---|---|
| AASL0001 | Anonymous objects must be destructured |
| AASL0002 | Complex objects should be destructured |
| AASL0003 | Complex objects in log context should be destructured |
| AASL0004 | Contextual logger type mismatch |
| AASL0005 | Exception passed as a template argument |
| AASL0006 | Duplicate template properties |
| AASL0007 | Template is not a compile-time constant |
| AASL0008 | Prefer named properties instead of positional ones |
| AASL0009 | Template property naming |
| AASL0010 | Context property naming |
| AASL0011 | Log messages should not end with a period |
| AASL0012 | Generated logging cannot use Semantic Conventions property names |
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 835 | 9/29/2026 |
| 0.1.0-preview.17 | 35 | 9/29/2026 |
| 0.1.0-preview.16 | 58 | 9/26/2026 |
| 0.1.0-preview.15 | 49 | 9/25/2026 |
| 0.1.0-preview.14 | 50 | 9/21/2026 |
| 0.1.0-preview.13 | 59 | 9/10/2026 |
| 0.1.0-preview.12 | 63 | 9/8/2026 |
| 0.1.0-preview.11 | 66 | 9/7/2026 |
| 0.1.0-preview.10 | 65 | 9/2/2026 |
| 0.1.0-preview.9 | 70 | 8/30/2026 |
| 0.1.0-preview.8 | 82 | 8/27/2026 |
| 0.1.0-preview.7 | 68 | 8/27/2026 |
| 0.1.0-preview.6 | 75 | 8/27/2026 |
| 0.1.0-preview.5 | 66 | 8/26/2026 |
| 0.1.0-preview.4 | 67 | 8/26/2026 |
| 0.1.0-preview.3 | 75 | 8/25/2026 |
| 0.1.0-preview.2 | 81 | 8/21/2026 |