How do I enable logging for HttpClient in a .NET Core console app?
问题 .NET Core 2.2 I have a basic CLI created with dotnet new console . It uses HttpClient to make web requests. How can I see trace or logging information about these requests? Data like this: https://www.stevejgordon.co.uk/httpclientfactory-asp-net-core-logging In the .NET Framework, you could turn on System Tracing: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-configure-network-tracing 回答1: In your appsettings.json file there will be an object which looks similar