From 8718b6717618d824f8938184b7a375c881ee84df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Sat, 2 Sep 2023 12:19:28 +0200 Subject: [PATCH] fixes logging configuration --- PiwigoDirectorySync/Program.cs | 5 ++++- PiwigoDirectorySync/appsettings.json | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PiwigoDirectorySync/Program.cs b/PiwigoDirectorySync/Program.cs index 3f37f03..ad55ef1 100644 --- a/PiwigoDirectorySync/Program.cs +++ b/PiwigoDirectorySync/Program.cs @@ -9,7 +9,10 @@ using PiwigoDirectorySync.Services; using Spectre.Console.Cli; var registrations = new ServiceCollection(); -registrations.AddLogging(l => l.AddSimpleConsole(c => + +registrations.AddSingleton(AppSettings.Config); +registrations.AddLogging(l => l.AddConfiguration(AppSettings.Config.GetSection("Logging")) + .AddSimpleConsole(c => { c.SingleLine = true; c.IncludeScopes = true; diff --git a/PiwigoDirectorySync/appsettings.json b/PiwigoDirectorySync/appsettings.json index 5409e05..94d1ba5 100644 --- a/PiwigoDirectorySync/appsettings.json +++ b/PiwigoDirectorySync/appsettings.json @@ -2,8 +2,8 @@ "Logging": { "LogLevel": { "Default": "Debug", - "System": "Information", - "Microsoft": "Information" + "System": "Warning", + "Microsoft": "Warning" } }, "ConnectionStrings": {