Added opt-in HttpClientLogging config
This commit is contained in:
parent
8844aaba75
commit
1fa6242c1c
@ -39,6 +39,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
.AddHealthChecks(Configuration)
|
||||
.AddCustomMvc(Configuration)
|
||||
.AddHttpClientServices(Configuration)
|
||||
//.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config
|
||||
.AddCustomAuthentication(Configuration);
|
||||
}
|
||||
|
||||
@ -216,6 +217,23 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddHttpClientLogging(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddLogging(b =>
|
||||
{
|
||||
b.AddFilter((category, level) => true); // Spam the world with logs.
|
||||
|
||||
// Add console logger so we can see all the logging produced by the client by default.
|
||||
b.AddConsole(c => c.IncludeScopes = true);
|
||||
|
||||
// Add console logger
|
||||
b.AddDebug();
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var useLoadTest = configuration.GetValue<bool>("UseLoadTest");
|
||||
|
Loading…
x
Reference in New Issue
Block a user