Microsoft.Testing.Extensions.Logging 1.0.0-alpha.26357.13

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

Microsoft.Testing.Extensions.Logging

Microsoft.Testing.Extensions.Logging is an extension for Microsoft.Testing.Platform that bridges the platform's logging pipeline with Microsoft.Extensions.Logging, so diagnostic messages produced by the platform and its extensions can flow through any Microsoft.Extensions.Logging provider — Console, Debug, Serilog, Application Insights, OpenTelemetry, custom sinks, and more.

Microsoft.Testing.Platform is open source. You can find Microsoft.Testing.Extensions.Logging code in the microsoft/testfx GitHub repository.

Install the package

dotnet add package Microsoft.Testing.Extensions.Logging

You will typically also add a Microsoft.Extensions.Logging provider package, e.g.:

dotnet add package Microsoft.Extensions.Logging.Console

Usage

using Microsoft.Extensions.Logging;
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.Builder;

ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(args);

builder.AddMicrosoftExtensionsLogging(logging =>
{
    logging.AddConsole();
    logging.AddDebug();
});

using ITestApplication app = await builder.BuildAsync();
return await app.RunAsync();

About

This package extends Microsoft.Testing.Platform with:

  • Bridge to Microsoft.Extensions.Logging: any MTP diagnostic log message is forwarded to the configured Microsoft.Extensions.Logging providers in addition to the platform's built-in --diagnostic file logger.
  • Reuse existing logging stacks: plug Serilog, OpenTelemetry logs, Application Insights, or your own custom ILoggerProvider into the testing platform without writing a custom MTP logger provider.

The bridge maps Microsoft.Testing.Platform.Logging.LogLevel to Microsoft.Extensions.Logging.LogLevel, forwards the same state, exception, and formatter through to Microsoft.Extensions.Logging.ILogger.Log, and respects per-category filter rules defined in the ILoggingBuilder.

Notes and limitations

  • EventId is not propagated. Microsoft.Testing.Platform's ILogger has no notion of EventId; every forwarded log entry is written with EventId.None. Consumers that rely on EventId-based filtering downstream of the bridge will not see distinct IDs.
  • Per-category filters can only narrow, never widen. The bridge initializes the ILoggingBuilder with the platform's effective diagnostic level, and the platform itself filters messages before they reach any provider. Setting a more verbose minimum level inside configure has no effect.
  • No-op when --diagnostic is off. When the platform's effective LogLevel is None (the default), the configure delegate is not invoked and no Microsoft.Extensions.Logging.LoggerFactory is created, so expensive sinks (network, file, gRPC) are not initialized for runs that will never emit a log.
  • LogAsync is forwarded synchronously. Microsoft.Extensions.Logging has no async logging API; ILogger.LogAsync is forwarded to ILogger.Log and returns Task.CompletedTask.
  • Owned vs. caller-owned factories. The Action<ILoggingBuilder> overload creates and disposes its own ILoggerFactory. The ILoggerFactory overload never disposes the caller-supplied instance.

Documentation

For comprehensive documentation, see https://aka.ms/testingplatform.

Feedback & contributing

Microsoft.Testing.Platform is an open source project. Provide feedback or report issues in the microsoft/testfx GitHub repository.

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 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. 
.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 was computed.  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

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.0.0-alpha.26357.13 0 7/7/2026