From ae7c53ed5715b301b5025c36ff9746f7922b79f2 Mon Sep 17 00:00:00 2001 From: support Date: Mon, 27 Nov 2023 21:54:10 +0100 Subject: [PATCH] Minor changes --- .../Middleware/ContextLoggingMiddleware.cs | 2 +- src/Web/Grand.Web/Program.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Web/Grand.Web.Common/Middleware/ContextLoggingMiddleware.cs b/src/Web/Grand.Web.Common/Middleware/ContextLoggingMiddleware.cs index 4acc34ada..f6453bf2a 100644 --- a/src/Web/Grand.Web.Common/Middleware/ContextLoggingMiddleware.cs +++ b/src/Web/Grand.Web.Common/Middleware/ContextLoggingMiddleware.cs @@ -23,7 +23,7 @@ public async Task InvokeAsync(HttpContext context) requestTelemetry.Properties.TryAdd("Store", workContext?.CurrentStore?.Name); requestTelemetry.Properties.TryAdd("Currency", workContext?.WorkingCurrency?.Name); requestTelemetry.Properties.TryAdd("Language", workContext?.WorkingLanguage?.Name); - + await _next(context); } } \ No newline at end of file diff --git a/src/Web/Grand.Web/Program.cs b/src/Web/Grand.Web/Program.cs index b463e2b72..0d69bf9d0 100644 --- a/src/Web/Grand.Web/Program.cs +++ b/src/Web/Grand.Web/Program.cs @@ -11,6 +11,12 @@ var builder = WebApplication.CreateBuilder(args); +//create logger +Log.Logger = new LoggerConfiguration() + .CreateBootstrapLogger(); + +Log.Information("Starting web application"); + builder.Host.UseDefaultServiceProvider((_, options) => { options.ValidateScopes = false; @@ -40,9 +46,6 @@ }); -//create logger -Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(builder.Configuration).CreateLogger(); - //add services StartupBase.ConfigureServices(builder.Services, builder.Configuration);