BetterLogging 1.0.0-alpha260122

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

BetterLogging Banner

BetterLogging

NuGet NuGet Downloads

⚠️ Status: Pre-release (alpha)
This package is a work in progress toward a stable, feature-rich release.


Overview

BetterLogging brings AI-assisted error analysis to .NET logging.

When an exception occurs, BetterLogging can send structured exception data to an AI model to:

  • Summarize what the error means
  • Explain common root causes
  • Suggest possible fixes

The goal is to make debugging faster—especially in complex or hard-to-reproduce scenarios.


⚠️ Important Notes

  • This package sends exception data to an external AI provider.
  • Use selectively in production (e.g., error paths, sampled logs).
  • AI responses are non-deterministic and should not be treated as authoritative.
  • This package does not automatically catch exceptions — you opt in explicitly.

Installation

Because this package is currently pre-release, install with:

dotnet add package BetterLogging --prerelease

Usage

Register service

Add the custom services in your program.cs.

services.AddBetterLoggingServices(options =>
{
    options.Model = Gemini.Models.FlashLite2_5;
    options.ApiKey = "YOUR API-KEY";
});

Example usage in code

Use IAiExceptionExplainer AI to pass your exception and receive a detailed result.

try
{
    ThrowSomething();
}
catch (Exception ex)
{
    var ai = provider.GetRequiredService<IAiExceptionExplainer>();
    var summary = await ai.ExplainAsync(ex);

    logger.LogError("AI Summary:\n{Summary}", summary);

    var p = 5;
}

License

This project is licensed under the MIT License.

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

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
1.0.0-alpha260122 93 1/22/2026
1.0.0-alpha260118-2 74 1/18/2026
1.0.0-alpha260118 72 1/18/2026

Cleaned up the setup.
Added icon.
Updated readme.