You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs don't mention how to get logs out of tests. There is a very brief comment that shows up in the xunit code sample, but it doesn't show
// To output logs to the xUnit.net ITestOutputHelper, // consider adding a package from https://www.nuget.org/packages?q=xunit+logging
It took me quite a while to work out that I was meant to use the AddLogging method on the services, and even longer to work out I needed to configure some default log filters as the appsettings.json from the application under test wasn't being replicated into the test projects.
Type of issue
Missing information
Description
The docs don't mention how to get logs out of tests. There is a very brief comment that shows up in the
xunit
code sample, but it doesn't showIt took me quite a while to work out that I was meant to use the
AddLogging
method on the services, and even longer to work out I needed to configure some default log filters as the appsettings.json from the application under test wasn't being replicated into the test projects.Page URL
https://learn.microsoft.com/en-us/dotnet/aspire/testing/write-your-first-test
Content source URL
https://github.com/dotnet/docs-aspire/blob/main/docs/testing/write-your-first-test.md
Document Version Independent Id
493680b6-598d-1d8c-6e0e-f54286ae77e0
Article author
@IEvangelist
The text was updated successfully, but these errors were encountered: