SinkSharp.Core
1.0.2
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
<PackageReference Include="SinkSharp.Core" Version="1.0.2" />
<PackageVersion Include="SinkSharp.Core" Version="1.0.2" />
<PackageReference Include="SinkSharp.Core" />
paket add SinkSharp.Core --version 1.0.2
#r "nuget: SinkSharp.Core, 1.0.2"
#:package SinkSharp.Core@1.0.2
#addin nuget:?package=SinkSharp.Core&version=1.0.2
#tool nuget:?package=SinkSharp.Core&version=1.0.2
SinkSharp.Core
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)
Links
| 🌐 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 | Versions 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. |
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.ObjectPool (>= 9.0.0)
- System.Threading.Channels (>= 9.0.0)
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.
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