From 6bab3cd9c013768c3040a02871e339106dfd680e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BChler?= Date: Tue, 5 Dec 2023 08:50:55 +0100 Subject: [PATCH] fix: use systemD logging --- .editorconfig | 3 +++ MumbleApi/Program.cs | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.editorconfig b/.editorconfig index bc20077..0b0a338 100644 --- a/.editorconfig +++ b/.editorconfig @@ -25,6 +25,9 @@ insert_final_newline = true # https://rules.sonarsource.com/csharp/RSPEC-6608/ dotnet_diagnostic.S6608.severity = None +# https://rules.sonarsource.com/csharp/RSPEC-112/ +dotnet_diagnostic.S112.severity = None + # https://rules.sonarsource.com/csharp/RSPEC-3925/ dotnet_diagnostic.S3925.severity = None diff --git a/MumbleApi/Program.cs b/MumbleApi/Program.cs index 8eacf25..c052dbc 100644 --- a/MumbleApi/Program.cs +++ b/MumbleApi/Program.cs @@ -1,4 +1,3 @@ -using System.Configuration; using System.Net; using System.Reflection; using System.Security.Claims; @@ -31,7 +30,7 @@ .AddJsonFile("appsettings.Secrets.json", true) .Build() #endif - .Get() ?? new(); + .Get() ?? throw new("App Config Not Loaded."); builder.Services.AddSingleton(config); builder.Services.AddLogging( @@ -39,12 +38,7 @@ #if DEBUG .AddConsole() #else - .AddJsonConsole( - c => - { - c.UseUtcTimestamp = true; - c.TimestampFormat = "dd.MM.yyyy - HH:mm:ss"; - }) + .AddSystemdConsole(c => c.UseUtcTimestamp = true) #endif .AddConfiguration(builder.Configuration));