Anarchy.Toolkit.Infrastructure.Telemetry.Serilog 1.0.1

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

Anarchy.Toolkit.Infrastructure.Telemetry.Serilog

Optional Serilog integration for Anarchy.Toolkit.Core.Telemetry. Serilog becomes one more Microsoft logging provider: the toolkit's instrumentation code does not change, and Core keeps no Serilog dependency.

services.AddSerilogTelemetry(logger);                    // application-owned logger, never disposed here
services.AddSerilogTelemetry(config => config.WriteTo.Console()); // logger owned and flushed by the container
  • Registration does not clear other logging providers, registers a given logger once, and keeps existing ICoreTelemetry, IMetricRecorder or AppTelemetry registrations (it ends with AddCoreTelemetry()). ModuleSerilogTelemetry is the same registration as a ModuleTelemetryBase.
  • SerilogConsoleDefaults gives composition roots that own their output (command-line tools) a readable console logger; AddSerilogConsoleTelemetry() adds it only when no logging provider is registered. Libraries never add it.
  • SerilogTelemetry.Create(logger) builds an AppTelemetry over a Serilog logger without DI.
  • Enrich.WithCorrelationId(correlationIdPropertyName, attemptIdPropertyName) is an opt-in enricher that reads the ambient CorrelationContext. It adds each property only when the event does not already have it (AddPropertyIfAbsent), so it never duplicates the properties a Serilog provider already took from the ILogger.BeginScope scope that Infrastructure.CorrelationId opens. Use it for events written outside such a scope (code that sets CorrelationContext.SetCorrelationValues directly); the property names default to those of the correlation package and must match what the scopes use.
  • Enrich.WithStructuredExceptionContext() adds a structured Exceptions property to events with an exception.
  • AddTelemetryLogMetrics() opts into log-based metrics: it decorates the registered IMetricRecorder with a LogMetricRecorder that also writes each metric as a log event (category Anarchy.Toolkit.Telemetry.Metrics) through the application's logging pipeline, for log backends that derive metrics from logs.

Metrics otherwise use the application's standard .NET metrics pipeline. This package has no AWS or vendor dependency.

Releases

See the release notes for the complete release history.

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 Anarchy.Toolkit.Infrastructure.Telemetry.Serilog:

Package Downloads
Anarchy.Toolkit.Automation.Build

Anarchy automation components, powered by Fallout Build: solution/test conventions, Microsoft.Testing.Platform-aware test runner, linting, layering checks, NuGet and ECR container release flows and local app runs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 0 11/21/2026
1.0.0 0 11/20/2026

## Releases

### 1.0.1

- chore(build): Format package release notes property

### 1.0.0

- Added optional DI integration for a consumer-configured Serilog logger, console defaults for composition roots, a
 non-DI construction path, the structured-exception and correlation-ID enrichers and opt-in log-based metrics.