PrimusSaaS.Logging 1.2.6

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

PrimusSaaS.Logging - Enterprise Logging for .NET

Package version: 1.2.4

Enterprise-grade structured logging library for .NET applications with automatic context enrichment, PII masking, and multiple output targets.

Recommendation: For vendor-neutral metrics and distributed tracing (OpenTelemetry), use the new PrimusSaaS.Observability module. Use this package (PrimusSaaS.Logging) if you specifically require local PII masking or custom file rotation sinks.

Features

  • Structured Logging - JSON-formatted logs with rich context
  • Log Levels - DEBUG, INFO, WARNING, ERROR, CRITICAL
  • Multiple Targets - Console, File, Azure Application Insights
  • PII Masking - Automatic redaction of sensitive data
  • File Rotation - Size-based rotation with gzip compression
  • Async Buffering - High-performance non-blocking logging
  • Custom Enrichers - Add dynamic context to every log
  • Standard ILogger - Full compatibility with Microsoft.Extensions.Logging
  • Serilog/NLog Bridge - Forward enriched logs into existing sink ecosystems
  • ASP.NET Core Integration - Middleware for automatic HTTP context enrichment

Installation

dotnet add package PrimusSaaS.Logging

Quick Start

Register Services

using PrimusSaaS.Logging.Extensions;

var builder = WebApplication.CreateBuilder(args);

builder.Logging.ClearProviders();
builder.Logging.AddPrimus(builder.Configuration.GetSection("PrimusLogging"));

var app = builder.Build();

app.UsePrimusLogging();

app.Run();

Performance

  • Async Buffering: Non-blocking writes with configurable buffer size.
  • Thread-Safe: Lock-free reads, minimal contention.
  • Compression: Gzip reduces storage by ~70%.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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.2.6 104 2/26/2026
1.2.5 88 2/25/2026
1.2.4 393 11/30/2025
1.2.3 436 11/30/2025
1.2.2 247 11/28/2025
1.2.1 212 11/24/2025
1.1.1 203 11/24/2025
1.1.0 206 11/24/2025
1.0.0 200 11/24/2025

v1.2.6:
- SECURITY: Added phone number masking (MaskPhones, default: true).
- SECURITY: Added IP address masking (MaskIPs, default: false — opt in for GDPR).
- SECURITY: Pinned System.Drawing.Common 8.0.0+ to eliminate NU1904 CVE warning.
- FIX: LogAuditAsync() extension now works on ILogger<T> and ILogger (not just internal Logger type).
- FIX: LogAuditExtensions namespace changed to PrimusSaaS.Logging.Extensions — matches the using statement in all docs.
- DOCS: Console guide updated — documented dual-output format for Pretty:true.
- DOCS: All version references updated to 1.2.6 across all doc pages.
- DOCS: Fixed TargetOptions → TargetConfig in troubleshooting.md code sample.
- TESTS: 6 new unit tests for phone/IP masking — 45/45 passing.

v1.2.5:
- DOCS: Fixed missing DI registration example in console guide (OrderService not wired).
- DOCS: Fixed sampling config — added appsettings.json approach alongside code approach.
- DOCS: Fixed enrichers section — clarified both using statements required.
- DOCS: Removed duplicate Next Steps section in overview.

v1.2.4:
- E2E tested: All endpoint tests passing with structured logging, correlation IDs, and PII masking.
- Verified API accuracy: UsePrimusLogging, LogLevel integration, async buffering.
- Production-ready with comprehensive copy-paste code samples.

v1.2.3:
- DOCS: Comprehensive documentation update with accurate implementation examples and best practices.
- Improved developer experience with clear migration guides and copy-paste ready samples.

v1.2.2: Resolved duplicate UsePrimusLogging extension ambiguity; safe serialization; scopes + correlation IDs; async buffering with metrics.