From 5a001bfcb95a8e6da7aab791861c9ad4d6e09d91 Mon Sep 17 00:00:00 2001 From: Felix Cornelissen Date: Tue, 26 Nov 2024 10:53:26 +0100 Subject: [PATCH] fix: request logging met serilog --- ODPC.Server/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ODPC.Server/Program.cs b/ODPC.Server/Program.cs index b017315..076d028 100644 --- a/ODPC.Server/Program.cs +++ b/ODPC.Server/Program.cs @@ -11,9 +11,9 @@ using var logger = new LoggerConfiguration() .MinimumLevel.Information() - .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) - .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information) //logeventlevel information voor Microsoft.AspNetCore.Authentication namespace omdat deze namespace de unauthorizations gooit, voorbeeld: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler: Information: AuthenticationScheme: Bearer was challenged. - .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Warning) + .MinimumLevel.Override("Microsoft.AspNetCore.Routing", LogEventLevel.Warning) + .MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning) .WriteTo.Console(new JsonFormatter()) .CreateLogger(); @@ -54,7 +54,7 @@ string GetRequiredConfig(string key) var app = builder.Build(); - app.UseSerilogRequestLogging(); + app.UseSerilogRequestLogging(x=> x.Logger = logger); app.UseDefaultFiles(); app.UseOdpcStaticFiles(); app.UseOdpcSecurityHeaders();