SinkSharp.Core 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package SinkSharp.Core --version 1.0.2
                    
NuGet\Install-Package SinkSharp.Core -Version 1.0.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="SinkSharp.Core" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SinkSharp.Core" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SinkSharp.Core" />
                    
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 SinkSharp.Core --version 1.0.2
                    
#r "nuget: SinkSharp.Core, 1.0.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 SinkSharp.Core@1.0.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=SinkSharp.Core&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SinkSharp.Core&version=1.0.2
                    
Install as a Cake Tool

SinkSharp.Core

NuGet NuGet Downloads License: Apache 2.0

High-performance structured logging for .NET 9. Drop-in ILogger<T> replacement with a striped async channel queue, MessageTemplate caching, object pooling, PII masking, and correlation ID auto-propagation.

Performance

Metric SinkSharp Serilog Difference
Hot path latency ~500 ns ~2,810 ns 4.2× faster
Allocation (0 props) 92 B 161 B 43% less
Lock contentions (32 threads) 1.3 979 891× less
E2E drain — 32 producers 31 ms — 0 dropped

Install

dotnet add package SinkSharp.Core
dotnet add package SinkSharp.Sinks.Console
dotnet add package SinkSharp.Sinks.File

Quick start — Console / Worker

var builder = SinkSharpBuilder
    .Create()
    .MinimumLevel(LogLevel.Information)
    .WithCorrelationId()
    .WithEnvironment("MyApp", "Production")
    .WithPiiMasking()
    .WriteTo(new ColoredConsoleSink())
    .WriteTo(new RollingFileSink("logs", "MyApp"));

var logger = builder.BuildLogger("MyApp.OrderService");
logger.Log(LogLevel.Information, "Order {Id} placed by {UserId}", orderId, userId);

Quick start — ASP.NET Core

// Without health check
builder.Services.AddSinkSharp(options => options
    .MinimumLevel(LogLevel.Information)
    .MinimumLevelFor("Microsoft", LogLevel.Warning)
    .WithCorrelationId()
    .WithEnvironment(appName, env)
    .WithPiiMasking()
    .WriteTo(new ColoredConsoleSink())
    .WriteTo(new RollingFileSink("logs", appName)));

// With health check → GET /health
builder.Services.AddSinkSharpWithHealth(options => options ...);
app.MapHealthChecks("/health");

Per-category log levels

.MinimumLevel(LogLevel.Debug)
.MinimumLevelFor("Microsoft",  LogLevel.Warning)
.MinimumLevelFor("System.Net", LogLevel.Error)

PII masking

.WithPiiMasking()
// "Contact john@example.com"    → "Contact ***@***.***"
// "Card 4111-1111-1111-1111"    → "Card ****-****-****-****"
// "SSN 123-45-6789"             → "SSN ***-**-****"

Dependencies

Package Version
Microsoft.Extensions.Logging.Abstractions 9.0.0
Microsoft.Extensions.Hosting.Abstractions 9.0.0
Microsoft.Extensions.DependencyInjection.Abstractions 9.0.0
Microsoft.Extensions.Diagnostics.HealthChecks 9.0.0
System.Threading.Channels 9.0.0

Release notes

v1.0.0

  • Striped async channel queue — one channel per CPU core, 891× less lock contention vs Serilog at 32 threads
  • MessageTemplate caching — zero parse cost after first call per unique template
  • LogEvent object pool — 43% less allocation at 0 properties
  • Built-in PII masking (email, credit card, SSN, phone)
  • Correlation ID auto-propagation via AsyncLocal — captured on caller thread, not drainer thread
  • Per-category minimum level overrides
  • MEL ILogger<T> compatible — no application code changes needed
  • ASP.NET Core DI integration with graceful shutdown drain
  • Built-in health check (Healthy / Degraded / Unhealthy)
🌐 Website https://www.sinksharp.com
📦 NuGet SinkSharp.Core
🧪 Samples https://github.com/SinkSharp/Samples
📧 Support support@sinksharp.com
📄 Licence Apache 2.0
📋 Changelog CHANGELOG.md
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 (4)

Showing the top 4 NuGet packages that depend on SinkSharp.Core:

Package Downloads
SinkSharp.Sinks.Dashboard

Embedded real-time log dashboard for SinkSharp. Mounts on your existing ASP.NET Core app at the same host and port — no extra process, no extra port, no separate log viewer licence required. Features: real-time SignalR streaming, 500-event circular buffer replay, level and service filters, full-text and regex search, correlation ID copy to clipboard, shareable URL with active filters, JSON and CSV export, reconnect indicator, per-sink minimum level, 6 authentication modes, Redis multi-pod backplane.

SinkSharp.Sinks.Console

Coloured console sink for SinkSharp — high-performance structured logging for .NET 9.

SinkSharp.Sinks.File

Rolling daily JSONL file sink for SinkSharp. Compact Log Event Format (CLEF) compatible. Every write flushed immediately to disk.

SinkSharp.Enrichers.Azure

Azure context enricher for SinkSharp. Stamps region, resource group, deployment slot, and pod name on every log event. Reads Azure environment variables once at startup — zero runtime cost.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.8 0 10/25/2026
1.0.6 75 10/21/2026
1.0.5 111 10/20/2026
1.0.4 104 10/18/2026
1.0.3 106 10/14/2026
1.0.2 171 10/11/2026
1.0.1 130 10/10/2026
1.0.0 100 10/8/2026

v1.0.1 — Bug fix: email regex [A-Z|a-z] corrected to [A-Za-z]
v1.0.0 — Initial release
• Striped async channel queue (one per CPU core)
• MessageTemplate caching — zero parse cost after first call
• LogEvent object pool — reduced GC pressure
• Built-in PII masking (email, credit card, SSN, phone)
• Correlation ID auto-propagation via AsyncLocal
• Per-category log level overrides
• MEL ILogger<T> compatible — no code changes needed
• Full GitHub Actions Trusted Publishing support
See full changelog: https://github.com/SinkSharp/.github/blob/main/profile/CHANGELOG.md