Skip to content

Commit

Permalink
fix: use systemD logging
Browse files Browse the repository at this point in the history
  • Loading branch information
buehler committed Dec 5, 2023
1 parent fec3446 commit 6bab3cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 2 additions & 8 deletions MumbleApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Configuration;
using System.Net;
using System.Reflection;
using System.Security.Claims;
Expand Down Expand Up @@ -31,20 +30,15 @@
.AddJsonFile("appsettings.Secrets.json", true)
.Build()
#endif
.Get<AppConfig>() ?? new();
.Get<AppConfig>() ?? throw new("App Config Not Loaded.");
builder.Services.AddSingleton(config);

builder.Services.AddLogging(
b => b
#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));

Expand Down

0 comments on commit 6bab3cd

Please sign in to comment.