From 1e7873dc805911a15a98699e26fbc1b06bdb44c8 Mon Sep 17 00:00:00 2001 From: Rafsanul Hasan Date: Thu, 4 Apr 2019 15:33:59 +0600 Subject: [PATCH] fix calling obsolete logging for ApplicationInsights --- src/Services/Webhooks/Webhooks.API/Startup.cs | 4 ++-- src/Web/WebSPA/Startup.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 9d39da719..81be5cff5 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -70,9 +70,9 @@ namespace Webhooks.API return new AutofacServiceProvider(container.Build()); } - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, ILoggingBuilder loggingBuilder) { - loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(loggingBuilder, options => options.IncludeScopes = true); var pathBase = Configuration["PATH_BASE"]; diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 7a418c432..4b79d4c6a 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -17,6 +17,7 @@ using WebSPA.Infrastructure; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Logging.ApplicationInsights; namespace eShopConContainers.WebSPA { @@ -73,9 +74,9 @@ namespace eShopConContainers.WebSPA // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery) + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ILoggingBuilder loggingBuilder, IAntiforgery antiforgery) { - loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(loggingBuilder, options => options.IncludeScopes = true); if (env.IsDevelopment()) {