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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alexaka1.Analyzers.StructuredLogging" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Alexaka1.Analyzers.StructuredLogging">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alexaka1.Analyzers.StructuredLogging --version 0.1.0
                    
#r "nuget: Alexaka1.Analyzers.StructuredLogging, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alexaka1.Analyzers.StructuredLogging@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alexaka1.Analyzers.StructuredLogging&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Alexaka1.Analyzers.StructuredLogging&version=0.1.0
                    
Install as a Cake Tool

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" />

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
There are no supported framework assets in this package.

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