LoggerUsage.MSBuild 1.0.0-preview.3

This is a prerelease version of LoggerUsage.MSBuild.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package LoggerUsage.MSBuild --version 1.0.0-preview.3
                    
NuGet\Install-Package LoggerUsage.MSBuild -Version 1.0.0-preview.3
                    
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="LoggerUsage.MSBuild" Version="1.0.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LoggerUsage.MSBuild" Version="1.0.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="LoggerUsage.MSBuild" />
                    
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 LoggerUsage.MSBuild --version 1.0.0-preview.3
                    
#r "nuget: LoggerUsage.MSBuild, 1.0.0-preview.3"
                    
#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 LoggerUsage.MSBuild@1.0.0-preview.3
                    
#: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=LoggerUsage.MSBuild&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LoggerUsage.MSBuild&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Tool

dotnet-logging-tools

This library is mostly vibe coded using github-copilot with the Claude Sonnet 4 model in agent mode

Create a summary of which log messages a project writes and the parameters to improve consistency

LoggerUsage LoggerUsage Downloads - Core library for analyzing .NET logging usage patterns

LoggerUsage.Cli LoggerUsage.Cli Downloads - Command-line tool for generating HTML/JSON reports

LoggerUsage.Mcp LoggerUsage.Mcp Downloads - Model Context Protocol server for AI integrations

LoggerUsage.MSBuild LoggerUsage.MSBuild Downloads - MSBuild integration for workspace analysis

Background

This tool analyzes .NET projects to extract and summarize logging usage patterns. It supports the following logging APIs:

Supported Logging APIs

  • ILogger Extension Methods: Analyzes usage of LogInformation, LogWarning, LogError, LogDebug, LogTrace, and LogCritical extension methods
  • LoggerMessage Attribute: Detects and analyzes methods decorated with [LoggerMessage] attribute for high-performance logging
  • LoggerMessage.Define: Analyzes usage of LoggerMessage.Define methods for compile-time log message generation
  • Structured Logging: Captures parameter names and templates used in structured logging scenarios

The tool helps identify:

  • Inconsistent parameter naming across log messages
  • Most commonly used log parameters
  • Log level distribution across your codebase
  • Template patterns and message structures

Usage

CLI

create HTML/JSON report:

dotnet run --project src/LoggerUsage.Cli -- <path-to-your-sln-or-csproj> <output-file-name>.<html/json>

Example report:

run the command:

dotnet run --project src/LoggerUsage.Cli -- src/LoggerUsage.Cli/LoggerUsage.Cli.csproj report.html

Logger Usage Report in light mode, showing summary cards, most common parameter names, and parameter name inconsistencies, with a light background and dark text for accessibility.

and in dark mode:

Logger Usage Report in dark mode, showing summary cards, most common parameter names, and parameter name inconsistencies, with a dark background and light text for accessibility.

Running the MCP Server Locally

To run the MCP server locally:

dotnet run --project src/LoggerUsage.Mcp

By default, the server will use the configuration in src/LoggerUsage.Mcp/appsettings.json. You can modify this file to adjust server settings as needed.

alt text

Roadmap

  • Add support for ILogger.Log method
  • Add support for ILogger.BeginScope method
  • Create a summary of the log messages
  • Integrate AI to suggest improvements and find inconsistencies
  • For LoggerMessageAttribute - find all invocations of method (see implementation plan)
  • Expose as a MCP
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LoggerUsage.MSBuild:

Package Downloads
LoggerUsage.Mcp

Model Context Protocol server for logging analysis integration with AI tools and IDEs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.4 161 11/6/2025
1.0.0-preview.3 141 10/1/2025
1.0.0-preview.2 144 9/29/2025