aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-10-25 17:46:26 +0200
committerivarlovlie <git@ivarlovlie.no>2022-10-25 17:46:26 +0200
commitc7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2 (patch)
tree49e95d1adb1c7a8c5b89299e5c031187077e72b7 /code
parent5ab1771e8ae7202cee69bb805d5b8b20103578d8 (diff)
downloadgreatoffice-c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2.tar.xz
greatoffice-c7fd9f9594c6e6dc5b3c750d7af87e51dba7e7f2.zip
feat: Remove appsettings.json and move logging levels to program.cs
Diffstat (limited to 'code')
-rw-r--r--code/api/src/Program.cs8
-rw-r--r--code/api/src/appsettings.json22
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.'"
- }
- }
- ]
- }
-}