SSF.Logging.Serilog 2.67.0

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

SSF.Logging.Serilog

Structured logging for .NET 10 API, Worker and Console hosts. Application code injects ILogger<T>; the host selects one logging mode.

Quick start

Add a sink to appsettings.json:

{
  "Serilog": {
    "Using": ["Serilog.Sinks.Console"],
    "MinimumLevel": "Information",
    "WriteTo": [{ "Name": "Console" }]
  }
}

Register Serilog in an API:

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
using Serilog;
using SSF.Logging.Serilog.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);
builder.AddSSFSerilog(builder.Configuration);
var app = builder.Build();
app.UseSerilogRequestLogging();
app.MapGet("/health", (ILoggerFactory factory) =>
{
    factory.CreateLogger("Health").LogInformation("Health checked");
    return Results.Ok();
});
await app.RunAsync();

Worker and Console hosts use the same registration on Host.CreateApplicationBuilder(args). Register workers before Build; start/stop and dispose the host normally. See complete examples.

Choose one mode

Entry point Logs Traces / metrics
AddSSFSerilog Serilog sinks Disabled
AddSSFOpenTelemetry Optional SDK logs Independently selectable
AddSSFObservability Serilog only Independently selectable SDK signals

Choose exactly one entry point per builder. Duplicate registration fails. For SDK signals, select Disabled, Console or Otlp; SDK-only mode requires at least one active signal. Combined mode rejects SDK logs. SDK log activation replaces existing logging providers; traces/metrics alone preserve them.

Use Serilog configuration for sinks/levels and SSF:Logging for identity and optional telemetry. Identity defaults to the host application name, entry assembly version and machine name. Override ServiceId for replicas sharing a machine. OTLP requires an explicit collector base URL. See configuration.

Context and application logs

Use structured templates: logger.LogInformation("Processed {Count} entries", count). Custom ILogEventEnricher implementations must be singleton-safe.

Opt into HTTP context with AddSSFRequestLoggingContext and UseSSFRequestLoggingContext; place the middleware after trusted forwarding/authentication and before authorization/request logging. UserId, UserName and UserIp are off by default. Background work uses logger.BeginSSFOperation(...) inside a using scope. See examples.

Implementation and limits

  • SerilogServiceCollectionExtensions selects/configures providers; Web overloads delegate to the shared host implementation. LoggingOptions prepares snapshots and validates options before registration.
  • SSFApplicationEnricher adds cached identity; context middleware adds per-request fields. Internal filters redact named structured secrets. Never log credentials in message text, exceptions or arbitrary objects.
  • The host owns logger disposal; registration preserves Log.Logger. Buffered OTLP may drop logs during overflow/outages and is unsuitable for durable audit delivery.
  • Optional sink/SDK dependencies are still installed when disabled. Worker/Console deployment needs the ASP.NET Core shared framework or a suitable self-contained publish.

Architecture · Migration · Review · Verification 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 (2)

Showing the top 2 NuGet packages that depend on SSF.Logging.Serilog:

Package Downloads
SSFFrameworks

SSF Frameworks

MicroservisFramework

Created by Sajad Khalili , Sara Arzhang , Omid Janbozorgi

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.67.0 96 11/11/2026
2.66.0 89 10/17/2026
2.65.0 89 10/16/2026
2.64.0 90 10/16/2026
2.63.0 93 10/9/2026
2.62.0 86 10/9/2026
2.61.0 87 10/7/2026
2.60.0 92 10/6/2026
2.59.0 83 10/6/2026
2.58.0 91 10/1/2026
2.57.0 86 9/29/2026
2.56.0 84 9/27/2026
2.55.0 90 9/26/2026
2.54.0 96 9/26/2026
2.53.0 84 9/25/2026
2.52.0 90 9/24/2026
2.51.0 80 9/24/2026
2.50.0 98 9/23/2026
2.49.0 101 9/23/2026
2.48.0 93 9/23/2026
Loading failed