From c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 25 Oct 2022 23:46:26 +0800 Subject: feat: Remove appsettings.json and move logging levels to program.cs --- code/api/src/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'code/api/src/Program.cs') diff --git a/code/api/src/Program.cs b/code/api/src/Program.cs index aa7cae3..5eed813 100644 --- a/code/api/src/Program.cs +++ b/code/api/src/Program.cs @@ -41,6 +41,7 @@ using IOL.GreatOffice.Api.Jobs; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Mvc.Versioning; using Quartz; +using Serilog.Events; namespace IOL.GreatOffice.Api; @@ -58,8 +59,11 @@ public static class Program var vaultService = builder.Services.BuildServiceProvider().GetRequiredService(); var configuration = vaultService.GetCurrentAppConfiguration(); var logger = new LoggerConfiguration() - .Enrich.FromLogContext() - .ReadFrom.Configuration(builder.Configuration) + .MinimumLevel.Information() + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning) .WriteTo.Console(); if (!builder.Environment.IsDevelopment() && configuration.SEQ_API_KEY.HasValue() && configuration.SEQ_API_URL.HasValue()) { -- cgit v1.3