CommshopBase.Observability 1.1.2

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

CommshopBase.Observability

NuGet Version NuGet Downloads Build

Global structured request logging and error handling middleware for Commerce-based services. Splunk-ready JSON logs via Serilog.

Features

  • CorrelationMiddleware: ensures X-Correlation-ID on inbound and outbound HTTP
  • RequestLoggingMiddleware: structured request logs (method, path, status, elapsed, trace, correlation, user)
  • ErrorHandlingMiddleware: returns RFC7807 ProblemDetails with traceId, correlationId, and code; structured error logs
  • Global error catalog with defaults and optional configuration overrides
  • Serilog integration (opt-in) with compact JSON console and optional Splunk HEC sink

Quick Start

// Program.cs
builder.Services.AddCommshopObservability(builder.Configuration);
var app = builder.Build();
app.UseCommshopObservability();

Optionally enable Serilog pipeline (console JSON + Splunk HEC):

// Program.cs
builder.Host.UseCommshopSerilog();

Configuration

Serilog (console + Splunk HEC)

{
  "Observability": {
    "Serilog": {
      "Enabled": true,
      "MinimumLevel": "Information",
      "Splunk": {
        "Url": "https://splunk-hec:8088/services/collector",
        "Token": "<hec-token>",
        "Index": "main",
        "BatchIntervalSeconds": 5,
        "BatchSizeLimit": 50,
        "QueueLimit": 10000
      }
    }
  }
}

Error Catalog (message dictionary)

{
  "ErrorCatalog": [
    { "Code": "ERR-VALIDATION", "Title": "Validation failed", "Type": "https://httpstatuses.com/400", "Detail": "One or more validation errors occurred." },
    { "Code": "ERR-NOT-FOUND", "Title": "Not Found", "Type": "https://httpstatuses.com/404", "Detail": "Resource was not found." }
  ]
}

CSP (dev/prod) in host apps

See repository README and docs/deploy.md for config keys.

Notes

  • Ensure builder.Services.AddCommshopObservability(...) is called before building the app.
  • Use app.UseCommshopObservability() early in the pipeline.
  • Serilog is optional and enabled via UseCommshopSerilog() + config.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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

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.1.2 475 11/11/2025
1.1.1 377 10/31/2025
1.1.0 209 10/31/2025
1.0.0 219 10/29/2025
0.1.3 377 10/29/2025

Security patch (v1.1.2):
- Pin System.Text.Json to 9.0.10 to mitigate .NET DoS vulnerabilities (CVE-2024-30105, CVE-2024-43485)
- No public API changes; safe upgrade