Franz.Common.Logging
3.0.2
dotnet add package Franz.Common.Logging --version 3.0.2
NuGet\Install-Package Franz.Common.Logging -Version 3.0.2
<PackageReference Include="Franz.Common.Logging" Version="3.0.2" />
<PackageVersion Include="Franz.Common.Logging" Version="3.0.2" />
<PackageReference Include="Franz.Common.Logging" />
paket add Franz.Common.Logging --version 3.0.2
#r "nuget: Franz.Common.Logging, 3.0.2"
#:package Franz.Common.Logging@3.0.2
#addin nuget:?package=Franz.Common.Logging&version=3.0.2
#tool nuget:?package=Franz.Common.Logging&version=3.0.2
Franz.Common.Logging
Serilog host-builder integration with environment-specific sinks, enrichment, and framework-noise filters.
Overview
Serilog host-builder integration with environment-specific sinks, enrichment, and framework-noise filters.
Installation
dotnet add package Franz.Common.Logging
Host-builder extensions
The package exposes three extensions in Franz.Common.Logging.Extensions.
UseLog
using Franz.Common.Logging.Extensions;
var host = Host.CreateDefaultBuilder(args)
.UseLog()
.Build();
await host.RunAsync();
UseLog() configures Serilog from host configuration and registered services, enriches events with log context, application name, machine name, and environment name, and applies the package's baseline source filters.
- Development: Debug minimum level, console and debug sinks, and daily rolling
logs/dev-.logfiles with a retained-file limit of 10. Franz.Common namespace events remain available for development diagnostics. - Non-development: Information minimum level, console output, daily JSON
logs/prod-sre-.jsonand human-readablelogs/prod-dev-.logfiles. Events whoseSourceContextis exactlyFranz.Commonor starts withFranz.Common.are excluded from this production-style pipeline at every level. - The filter is applied to the logger pipeline, so it applies consistently to all sinks configured through this non-development branch, including sinks loaded from Serilog configuration.
The filter matches the structured SourceContext property only. It does not suppress application events merely because their message text mentions Franz.Common, and it does not match similarly prefixed namespaces such as Franz.Commonish.
The extension configures UTF-8 console encoding and invokes TraceHelper.LogConsole(). Elastic APM agent setup is compiled only in DEBUG builds; it is not an unconditional production APM registration.
UseDesktopLog
var host = Host.CreateDefaultBuilder(args)
.UseDesktopLog()
.Build();
This uses a desktop-oriented template with thread ID enrichment, console/debug sinks, and daily rolling logs/desktop-.log files. It does not add request ID or request path fields to the output template. The production-only Franz.Common source filter does not apply to this development-oriented desktop pipeline.
UseHybridLog
var host = Host.CreateDefaultBuilder(args)
.UseHybridLog()
.Build();
This applies baseline filters, reads Serilog configuration, enriches from log context, application name, and machine name. It does not add the explicit console/file sinks used by UseLog or UseDesktopLog; configure sinks through host Serilog configuration.
Filtering and enrichment
The baseline configuration excludes selected low-value framework sources, including EF Core internals, HttpClient, Data Protection, static files, host lifetime, health-check diagnostics, Kestrel transport, and selected routing/model-binding/versioning events below Warning. The additional Franz.Common namespace suppression is intentionally limited to the non-development branch of UseLog().
Operational guidance
- Configure sink destinations, retention, access controls, and shipping in accordance with the deployment environment.
- Treat logs as potentially sensitive data. Avoid credentials, tokens, and unnecessary personal data.
- Do not assume the package configures an OpenTelemetry exporter or an Elastic APM production agent.
- Choose one host logging extension deliberately; do not stack multiple competing Serilog configurations.
License
MIT. See LICENSE.
| Product | Versions 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. |
-
net10.0
- Elastic.Apm.Extensions.Hosting (>= 1.34.5)
- Elastic.Apm.NetCoreAll (>= 1.34.5)
- Elastic.Apm.SerilogEnricher (>= 9.0.0)
- Elastic.Serilog.Sinks (>= 9.0.0)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Enrichers.Demystifier (>= 1.0.3)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.Debug (>= 3.0.0)
- Serilog.Sinks.Elasticsearch (>= 10.0.0)
- Serilog.Sinks.File (>= 7.0.0)
- SharpCompress (>= 0.50.7)
- Snappier (>= 1.3.1)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Franz.Common.Logging:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.Hosting
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Bootstrap
Shared utility library for the Franz Framework. |
|
|
Franz.Common.SSO
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging.AzureEventBus
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging.AzureEventHubs
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2 | 0 | 11/20/2026 |
| 3.0.1 | 0 | 11/19/2026 |
| 3.0.0 | 249 | 11/10/2026 |
| 2.3.4 | 511 | 11/1/2026 |
| 2.3.3 | 473 | 10/28/2026 |
| 2.3.2 | 264 | 10/27/2026 |
| 2.3.1 | 315 | 10/26/2026 |
| 2.3.0 | 431 | 7/21/2026 |
| 2.2.19 | 306 | 7/19/2026 |
| 2.2.18 | 309 | 7/19/2026 |
| 2.2.17 | 2,774 | 7/12/2026 |
| 2.2.16 | 311 | 7/2/2026 |
| 2.2.15 | 311 | 6/29/2026 |
| 2.2.14 | 314 | 6/29/2026 |
| 2.2.13 | 304 | 6/29/2026 |
| 2.2.12 | 302 | 6/28/2026 |
| 2.2.11 | 320 | 6/28/2026 |
| 2.2.10 | 312 | 6/28/2026 |
| 2.2.9 | 306 | 6/28/2026 |
| 2.2.8 | 300 | 6/28/2026 |