Microsoft.Testing.Extensions.Logging
1.0.0-alpha.26507.8
Prefix Reserved
dotnet add package Microsoft.Testing.Extensions.Logging --version 1.0.0-alpha.26507.8
NuGet\Install-Package Microsoft.Testing.Extensions.Logging -Version 1.0.0-alpha.26507.8
<PackageReference Include="Microsoft.Testing.Extensions.Logging" Version="1.0.0-alpha.26507.8" />
<PackageVersion Include="Microsoft.Testing.Extensions.Logging" Version="1.0.0-alpha.26507.8" />
<PackageReference Include="Microsoft.Testing.Extensions.Logging" />
paket add Microsoft.Testing.Extensions.Logging --version 1.0.0-alpha.26507.8
#r "nuget: Microsoft.Testing.Extensions.Logging, 1.0.0-alpha.26507.8"
#:package Microsoft.Testing.Extensions.Logging@1.0.0-alpha.26507.8
#addin nuget:?package=Microsoft.Testing.Extensions.Logging&version=1.0.0-alpha.26507.8&prerelease
#tool nuget:?package=Microsoft.Testing.Extensions.Logging&version=1.0.0-alpha.26507.8&prerelease
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 configuredMicrosoft.Extensions.Loggingproviders in addition to the platform's built-in--diagnosticfile logger. - Reuse existing logging stacks: plug Serilog, OpenTelemetry logs, Application Insights, or your own custom
ILoggerProviderinto 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
EventIdis not propagated. Microsoft.Testing.Platform'sILoggerhas no notion ofEventId; every forwarded log entry is written withEventId.None. Consumers that rely onEventId-based filtering downstream of the bridge will not see distinct IDs.- MTP does not create logging scopes. The bridge does not synthesize or translate
BeginScopeoperations because Microsoft.Testing.Platform's logging contract has no scope API. Ambient scopes created by the caller may still be observed by its providers, but they are not controlled by MTP. - Structured state is forwarded, not reconstructed. The original state and formatter are passed unchanged to the Microsoft.Extensions logger. Providers can retain structure that was present in the original MTP log entry, but the bridge cannot recover message-template properties from an entry that was already produced as a formatted string.
- Per-category filters can only narrow, never widen. The bridge initializes the
ILoggingBuilderwith the platform's effective diagnostic level, and the platform itself filters messages before they reach any provider. Setting a more verbose minimum level insideconfigurehas no effect. - No-op when
--diagnosticis off. When the platform's effectiveLogLevelisNone(the default), theconfiguredelegate is not invoked and noMicrosoft.Extensions.Logging.LoggerFactoryis created, so expensive sinks (network, file, gRPC) are not initialized for runs that will never emit a log. LogAsyncis forwarded synchronously.Microsoft.Extensions.Logginghas no async logging API;ILogger.LogAsynccallsILogger.Logdirectly and returnsTask.CompletedTask. The bridge does not block on asynchronous work, but a provider that performs blocking I/O still blocks the calling thread.- Owned vs. caller-owned factories. The
Action<ILoggingBuilder>overload creates and disposes its ownILoggerFactory. TheILoggerFactoryoverload never disposes the caller-supplied instance. - Registration is process-local. A supplied logger factory cannot cross a process boundary. Separately launched test host or controller processes must register their own bridge if their diagnostic logs need to reach the same external system.
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 | Versions 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. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Testing.Platform (>= 2.5.1 && < 3.0.0)
-
net8.0
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Testing.Platform (>= 2.5.1 && < 3.0.0)
-
net9.0
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Testing.Platform (>= 2.5.1 && < 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.Testing.Extensions.Logging:
| Package | Downloads |
|---|---|
|
Microsoft.Testing.Extensions.Hosting
This package composes an application-owned Microsoft.Extensions.Hosting host with Microsoft.Testing.Platform while preserving host ownership and the dependency-free platform core. Microsoft Testing is a set of platform, framework and protocol intended to make it possible to run any test on any target or device. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.26507.8 | 33 | 10/7/2026 |
| 1.0.0-alpha.26506.1 | 63 | 10/6/2026 |
| 1.0.0-alpha.26466.3 | 70 | 9/16/2026 |
| 1.0.0-alpha.26452.8 | 74 | 9/2/2026 |
| 1.0.0-alpha.26377.5 | 94 | 7/28/2026 |
| 1.0.0-alpha.26363.8 | 79 | 7/13/2026 |
| 1.0.0-alpha.26358.12 | 88 | 7/8/2026 |
| 1.0.0-alpha.26357.13 | 84 | 7/7/2026 |
See the release notes at https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md#2.5.1.