Logging.Client 1.6.0

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

Logging.Client

NuGet License: MIT

Shared structured logging configuration with Serilog, Grafana Loki sink, PII masking, correlation ID tracking, and tenant-aware enrichers for all SaaS services.

Installation

dotnet add package Logging.Client

Description

Shared structured logging configuration with Serilog, Grafana Loki sink, PII masking, correlation ID tracking, and tenant-aware enrichers for all SaaS services.

Sink selection (read this before setting SinkType)

The console sink is the default and the recommended sink everywhere. Promtail runs on both clusters and already ships container stdout to the real Loki (prod promtail → http://10.0.0.2:31300/loki/api/v1/push, label cluster: prod), so the direct Serilog Loki sink is redundant — it only adds a failure mode.

That failure mode is a memory leak, not an outage. The Grafana Loki sink buffers every event it cannot deliver. Pointed at a host that does not resolve, delivery can never succeed, so the buffer only grows until the pod is OOMKilled. LokiQueueLimit bounds how big that buffer gets; it does not notice that the sink is dead.

Since 1.6.0 the package therefore:

  • defaults SinkType to Console;
  • runs a startup guard when SinkType = Loki — it resolves the configured Loki host in DNS (2 s hard bound, never throws, never blocks boot) and, if the host does not resolve or the URL is malformed, prints a loud *** LOKI SINK DISABLED *** banner to stderr and falls back to the console sink;
  • binds Logging:SinkType and Logging:LokiUrl from configuration, so the opt-in below actually reaches the options.
# opt back into the direct sink (both required — the URL default is NXDOMAIN in prod)
Logging__SinkType=Loki
Logging__LokiUrl=http://loki.monitoring.svc.cluster.local:3100

Configuration wins over the values passed to AddStructuredLogging(opts => ...).

Documentation

See the NuGet package page for full documentation.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

How to Publish

The API key is read automatically from SaaS/.env.local (NUGET_API_KEY) — never pass or paste -ApiKey.

cd C:\desktopContents\projects\SaaS\NuGetPackages\Logging.Client
.\publish.ps1 -Bump patch   # Bug fixes
.\publish.ps1 -Bump minor   # New features
.\publish.ps1 -Bump major   # Breaking changes
.\publish.ps1 -NoBump       # Publish the version already in Directory.Build.props
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

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.6.0 86 8/12/2026
1.5.1 198 7/8/2026
1.3.0 178 5/1/2026
1.0.1 458 3/7/2026