Bizrk.AgentLedger.Hosting 1.0.3

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

Bizrk Agent Ledger (.NET)

Agent Ledger is a runtime telemetry pipeline that enforces a strict boundary between library instrumentation and host environment configuration.

This is the C# equivalent of the @bizrk/agent-ledger TypeScript package, ensuring 1-to-1 parity for full-stack, chronologically perfect logging.

Core Philosophy

  • Libraries emit structured entries only. They do not manage outputs, filters, or formatting.
  • The Host Application owns all configuration and outputs.
  • Strict Vocabulary: Uses a bounded set of semantic categories (app, action, network, flow, etc.).

Packages

Install the packages you need for your specific project layer:

dotnet add package Bizrk.AgentLedger.Core
dotnet add package Bizrk.AgentLedger.Hosting
dotnet add package Bizrk.AgentLedger.AspNetCore
  • Core: Pure C#. Interfaces (IAgentLedger) and AsyncLocal context. Perfect for class libraries.
  • Hosting: Sinks (Console, File, InMemory), AgentLedgerConfig, and MS DI registration.
  • AspNetCore: AgentLedgerMiddleware (Support Mode Header parsing) and the secure /stream endpoint.

Quick Start (ASP.NET Core)

1. Configuration (appsettings.json)

{
  "AgentLedger": {
    "Enabled": true,
    "Level": "Debug",
    "Categories": ["app", "flow", "action", "error", "engine"],
    "Console": { "Enabled": true },
    "File": { "Enabled": true, "Path": "agentledger.log" }
  }
}

2. Bootstrapping (Program.cs)

using Bizrk.AgentLedger.Hosting;
using Bizrk.AgentLedger.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddAgentLedger(builder.Configuration);
builder.Logging.AddAgentLedgerBridge(); // Pipes standard ILogger traffic into Agent Ledger

var app = builder.Build();

app.UseAgentLedgerContext(); // Reads X-Agent-Ledger-Session-Id headers
app.MapAgentLedgerEndpoints().RequireAuthorization(); // Exposes /api/system/agent-ledger/stream

app.Run();

3. Usage

public class OrderService
{
    private readonly IAgentLedger _logger;

    public OrderService(IAgentLedger ledger)
    {
        _logger = ledger.Scope("OrderService", LogCategory.Flow);
    }

    public void Process()
    {
        _logger.Info("Processing started");
    }
}

4. Custom Enterprise Sinks (Azure, Datadog) Do not pipe Agent Ledger logs back into standard .NET ILogger. Doing so creates infinite loops (since standard logs are piped into Agent Ledger) and destroys the highly structured JSON payloads.

To integrate with enterprise observability platforms, create a custom IAgentLedgerSink:

public class AzureAppInsightsSink : IAgentLedgerSink
{
    public void Emit(LedgerEntry entry)
    {
        // Send structured JSON perfectly to Azure
        _telemetry.TrackTrace(entry.Message, entry.Level, new Dictionary<string, string> {
            { "SessionId", entry.SessionId },
            { "Category", entry.Category.ToString() }
        });
    }
}

Register it via DI:

builder.Services.AddSingleton<IAgentLedgerSink, AzureAppInsightsSink>();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 Bizrk.AgentLedger.Hosting:

Package Downloads
Bizrk.AgentLedger.AspNetCore

ASP.NET Core middleware and endpoints for Agent Ledger (Support Mode Context and Streaming).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 183 4/28/2026
1.0.2 120 4/28/2026
1.0.0 147 4/28/2026