Microsoft.Testing.Extensions.Logging
1.0.0-alpha.26357.13
Prefix Reserved
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
<PackageReference Include="Microsoft.Testing.Extensions.Logging" Version="1.0.0-alpha.26357.13" />
<PackageVersion Include="Microsoft.Testing.Extensions.Logging" Version="1.0.0-alpha.26357.13" />
<PackageReference Include="Microsoft.Testing.Extensions.Logging" />
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"
#:package Microsoft.Testing.Extensions.Logging@1.0.0-alpha.26357.13
#addin nuget:?package=Microsoft.Testing.Extensions.Logging&version=1.0.0-alpha.26357.13&prerelease
#tool nuget:?package=Microsoft.Testing.Extensions.Logging&version=1.0.0-alpha.26357.13&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.- 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.LogAsyncis forwarded toILogger.Logand returnsTask.CompletedTask.- Owned vs. caller-owned factories. The
Action<ILoggingBuilder>overload creates and disposes its ownILoggerFactory. TheILoggerFactoryoverload 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 | 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.3.0)
-
net8.0
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Testing.Platform (>= 2.3.0)
-
net9.0
- Microsoft.Extensions.Logging (>= 9.0.4)
- Microsoft.Testing.Platform (>= 2.3.0)
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 |