FclEx.Logging 2.4.2

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

FclEx.Logging

Microsoft.Extensions.Logging helpers for FclEx.

What Is Included

  • Logger factory and provider convenience helpers.
  • In-memory collectors for log messages, metadata, and scopes.
  • Scoped logging-property helpers.
  • Logging helpers for supplied operation durations.
  • Null logger fallbacks and cleanup utilities.
  • Logging provider registration and service cleanup.

Usage Notes

  • This package uses Microsoft logging abstractions.
  • Serilog-specific helpers live in FclEx.Serilog.
  • Use scoped properties when downstream providers need structured context for an operation.

Collecting Logs

For a standalone collector:

using FclEx.Logging;
using Microsoft.Extensions.Logging;

var logger = new CollectingLogger("example");
using (logger.PushProperty("RequestId", 42))
{
    logger.LogInformation("Processing {Count} items", 3);
}

var entry = logger.Entries[0];
// entry.Message: "Processing 3 items"
// entry.State: the original structured message state
// entry.Scopes: the active scopes, ordered from outermost to innermost
logger.Clear();

Register the collector through ILoggingBuilder when using dependency injection:

using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddLogging(builder => builder
    .SetMinimumLevel(LogLevel.Trace)
    .AddCollecting());

using var serviceProvider = services.BuildServiceProvider();
var factory = serviceProvider.GetRequiredService<ILoggerFactory>();
var collector = serviceProvider.GetRequiredService<CollectingLoggerProvider>();
factory.CreateLogger("example").LogDebug("Collected message");

var entries = collector.Entries;
collector.Clear();

For an existing factory, factory.AddCollecting() returns the newly added collector. Repeated calls to the builder extension register one singleton collector; repeated calls to the factory extension add independent collectors. Factory filters apply in both cases.

Entries returns a synchronized snapshot. Later writes and Clear() do not alter earlier snapshots. A provider combines entries from every category, and its loggers share that store. Scope stack membership is captured when a message is logged, while state and scope values remain the original objects and are not deep copied. Standalone collectors maintain their own async scope context; provider-created loggers share the factory's scope context.

Collectors accept every defined level except LogLevel.None. They retain entries until explicitly cleared, including after provider disposal, so clear them between test phases or when the retained data is no longer needed.

Property Wrappers and Scopes

logger.With("UserId", userId) creates a PropertiesLogger. Property definitions are copied when the wrapper is constructed; object values are retained by reference. LazyLoggerProperty.ValueFactory runs once per enabled log call. Its result is captured before the property scope begins, so all providers and later inspections see the same value for that entry. Disabled calls do not evaluate lazy factories. Factory exceptions propagate without writing the message, and temporary scopes are restored on failure.

logger.Properties() returns a LoggerPropertyScope. Each Push immediately starts a property scope; disposing the group releases its scopes in reverse order. Dispose nested scopes before their enclosing scopes. PushProperty enumerates an input sequence once and captures its property definitions; null or empty sequences start no scope. Structured property output requires a provider that supports structured scopes. Serilog's destructureObjects overloads live in FclEx.Serilog.

RemoveLogging removes factories, providers, untyped loggers, and both open and closed ILogger<T> registrations. It unregisters logging rather than replacing it with null loggers, and leaves options, concrete provider registrations, and existing service providers unchanged. AddLogging can register logging again afterward.

API Changes

  • The factory extension SetMinimumLevel and its private-field reflection helper have been removed. Configure initial levels through ILoggingBuilder.SetMinimumLevel; use Microsoft's options/configuration change notifications for runtime updates.
  • LoggerProperties is now LoggerPropertyScope, and its integration extension classes are named LoggerPropertyScopeExtensions.
  • FclEx.Logging.Extensions is now FclEx.Logging.LoggerExtensions.
  • LazyLoggerProperty.Value is now ValueFactory.
  • Provider type categories now match Microsoft's factory categories, including the exclusion of generic arguments. Update category-specific filters if necessary.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on FclEx.Logging:

Package Downloads
FclEx.Http

HTTP service helpers, request actions, response parsing, downloads/uploads, cookies, authentication, AngleSharp HTML helpers, and user-client abstractions.

FclEx.Serilog

Serilog configuration helpers, enrichers, filters, formatters, and sinks.

FclEx.AspNetCore

ASP.NET Core helpers for requests, sessions, model state, endpoints, authorization, request buffering, decompression, and logging context.

FclEx.Xunit

xUnit v2 assertions, conditional test attributes, output helpers, logging integration, and test utilities.

FclEx.Messaging

Kafka and RabbitMQ helpers for consumers, publishers, routers, message conversion, retry metadata, and messaging logs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.2 425 10/10/2026
2.4.1 406 10/8/2026
2.4.0 423 10/3/2026
2.3.9 413 9/27/2026
2.3.8 396 9/26/2026
2.3.7 398 9/24/2026
2.3.6 411 9/22/2026
2.3.5 416 9/22/2026
2.3.4 452 8/28/2026
2.3.3 495 8/22/2026
2.3.2 465 8/20/2026
2.3.1 467 8/19/2026
2.3.0 489 8/17/2026
2.2.9 567 7/18/2026
2.2.8 556 6/13/2026
2.2.6 518 6/8/2026
2.2.5 505 6/5/2026
2.2.4 499 6/5/2026
2.2.3 542 5/27/2026
2.2.2 518 5/26/2026
Loading failed