diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-25 17:46:26 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-25 17:46:26 +0200 |
| commit | c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2 (patch) | |
| tree | 49e95d1adb1c7a8c5b89299e5c031187077e72b7 /code/api/src/Program.cs | |
| parent | 5ab1771e8ae7202cee69bb805d5b8b20103578d8 (diff) | |
| download | greatoffice-c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2.tar.xz greatoffice-c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2.zip | |
feat: Remove appsettings.json and move logging levels to program.cs
Diffstat (limited to 'code/api/src/Program.cs')
| -rw-r--r-- | code/api/src/Program.cs | 8 |
1 files changed, 6 insertions, 2 deletions
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<VaultService>(); 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()) { |
