Meziantou.Extensions.Logging.Xunit 1.0.8

Prefix Reserved
dotnet add package Meziantou.Extensions.Logging.Xunit --version 1.0.8                
NuGet\Install-Package Meziantou.Extensions.Logging.Xunit -Version 1.0.8                
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="Meziantou.Extensions.Logging.Xunit" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Meziantou.Extensions.Logging.Xunit --version 1.0.8                
#r "nuget: Meziantou.Extensions.Logging.Xunit, 1.0.8"                
#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.
// Install Meziantou.Extensions.Logging.Xunit as a Cake Addin
#addin nuget:?package=Meziantou.Extensions.Logging.Xunit&version=1.0.8

// Install Meziantou.Extensions.Logging.Xunit as a Cake Tool
#tool nuget:?package=Meziantou.Extensions.Logging.Xunit&version=1.0.8                

Meziantou.Extensions.Logging.Xunit

ILogger logger = XUnitLogger.CreateLogger();
ILogger<MyType> logger = XUnitLogger.CreateLogger<MyType>();

If you are using a WebApplicationFactory:

public class UnitTest1(ITestOutputHelper testOutputHelper)
{
    [Fact]
    public async Task Test1()
    {
        using var factory = new WebApplicationFactory<Program>()
            .WithWebHostBuilder(builder =>
            {
                builder.ConfigureLogging(builder =>
                {
                    // You can override the logging configuration if needed
                    //builder.SetMinimumLevel(LogLevel.Trace);
                    //builder.AddFilter(_ => true);

                    // Register the xUnit logger provider
                    builder.Services.AddSingleton<ILoggerProvider>(new XUnitLoggerProvider(testOutputHelper, appendScope: false));
                });
            });
    }
}

Blog post about this package: How to write logs from ILogger to xUnit.net ITestOutputHelper

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. 
.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 (2)

Showing the top 2 NuGet packages that depend on Meziantou.Extensions.Logging.Xunit:

Package Downloads
FunFair.Test.Common

FunFair Common Test Infrastructure for building xUnit tests on top of.

Drammer.Web.IntegrationTesting

Integration testing framework for the Drammer whisky app.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Meziantou.Extensions.Logging.Xunit:

Repository Stars
NikiforovAll/keycloak-authorization-services-dotnet
Authentication and Authorization with Keycloak and ASP.NET Core 🔐
SSWConsulting/SSW.CleanArchitecture
SSW Clean Architecture Template
Version Downloads Last updated
1.0.8 6,186 11/17/2024
1.0.7 371,042 11/15/2023
1.0.6 70,437 5/24/2023
1.0.5 194 4/12/2023
1.0.3 267 4/10/2023
1.0.2 3,385 7/14/2021
1.0.1 371 4/22/2021
1.0.0 1,007 2/4/2021