.net core 2.0 ConfigureLogging xunit test
In my xUnit integration test in my .NET Core 2.0 project I cannot see log messages in the terminal that also prints the test results. When the code is run in WebHost environment, the logs are printed out to the console. This is how I configure logging in the test's constructor: var config = new ConfigurationBuilder() .AddJsonFile("appsettings.Tests.json") .Build(); var services = new ServiceCollection(); services.AddLogging(options => { options.AddConfiguration(config.GetSection("Logging")); options.AddConsole(); options.AddDebug(); }); var serviceProvider = services.BuildServiceProvider();