diff options
| -rw-r--r-- | code/api/src/Program.cs | 8 | ||||
| -rw-r--r-- | code/api/src/appsettings.json | 22 |
2 files changed, 6 insertions, 24 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()) { diff --git a/code/api/src/appsettings.json b/code/api/src/appsettings.json deleted file mode 100644 index 8727fd7..0000000 --- a/code/api/src/appsettings.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "AllowedHosts": "*", - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "Microsoft.EntityFrameworkCore": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "Filter": [ - { - "Name": "ByExcluding", - "Args": { - "expression": "@mt = 'An unhandled exception has occurred while executing the request.'" - } - } - ] - } -} |
