From 882bde713fe3f60345b934b812f3c6aad70e580c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 14 Aug 2024 17:11:53 +0300 Subject: [PATCH] Upgrade nlog to 5.3.3 Closes #10265 --- .../Instrumentation/NzbDroneLogger.cs | 22 +++++++++---------- src/NzbDrone.Common/Radarr.Common.csproj | 4 ++-- .../Instrumentation/ReconfigureLogging.cs | 1 + src/NzbDrone.Core/Radarr.Core.csproj | 2 +- src/NzbDrone.Host/Startup.cs | 4 ++-- .../Radarr.Test.Common.csproj | 2 +- src/NzbDrone.Update/Radarr.Update.csproj | 2 +- src/NzbDrone.Windows/Radarr.Windows.csproj | 2 +- src/Radarr.Api.V3/Radarr.Api.V3.csproj | 2 +- src/Radarr.Http/Radarr.Http.csproj | 2 +- 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs b/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs index 619860e9b..9f1f6ed9d 100644 --- a/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs +++ b/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs @@ -104,17 +104,6 @@ namespace NzbDrone.Common.Instrumentation LogManager.Configuration.LoggingRules.Add(loggingRule); } - private static void RegisterGlobalFilters() - { - LogManager.Setup().LoadConfiguration(c => - { - c.ForLogger("System.*").WriteToNil(LogLevel.Warn); - c.ForLogger("Microsoft.*").WriteToNil(LogLevel.Warn); - c.ForLogger("Microsoft.Hosting.Lifetime*").WriteToNil(LogLevel.Info); - c.ForLogger("Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware").WriteToNil(LogLevel.Fatal); - }); - } - private static void RegisterConsole() { var level = LogLevel.Trace; @@ -196,6 +185,17 @@ namespace NzbDrone.Common.Instrumentation LogManager.Configuration.LoggingRules.Insert(0, rule); } + private static void RegisterGlobalFilters() + { + LogManager.Setup().LoadConfiguration(c => + { + c.ForLogger("System.*").WriteToNil(LogLevel.Warn); + c.ForLogger("Microsoft.*").WriteToNil(LogLevel.Warn); + c.ForLogger("Microsoft.Hosting.Lifetime*").WriteToNil(LogLevel.Info); + c.ForLogger("Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware").WriteToNil(LogLevel.Fatal); + }); + } + public static Logger GetLogger(Type obj) { return LogManager.GetLogger(obj.Name.Replace("NzbDrone.", "")); diff --git a/src/NzbDrone.Common/Radarr.Common.csproj b/src/NzbDrone.Common/Radarr.Common.csproj index 83f6e6719..ea19653f4 100644 --- a/src/NzbDrone.Common/Radarr.Common.csproj +++ b/src/NzbDrone.Common/Radarr.Common.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs index 38d4e627a..08cb4ca60 100644 --- a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs +++ b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs @@ -117,6 +117,7 @@ namespace NzbDrone.Core.Instrumentation syslogTarget.MessageSend.Protocol = ProtocolType.Udp; syslogTarget.MessageSend.Udp.Port = syslogPort; syslogTarget.MessageSend.Udp.Server = syslogServer; + syslogTarget.MessageSend.Retry.ConstantBackoff.BaseDelay = 500; syslogTarget.MessageCreation.Rfc = RfcNumber.Rfc5424; syslogTarget.MessageCreation.Rfc5424.AppName = _configFileProvider.InstanceName; diff --git a/src/NzbDrone.Core/Radarr.Core.csproj b/src/NzbDrone.Core/Radarr.Core.csproj index 96a8d26d1..8b68ac511 100644 --- a/src/NzbDrone.Core/Radarr.Core.csproj +++ b/src/NzbDrone.Core/Radarr.Core.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/NzbDrone.Host/Startup.cs b/src/NzbDrone.Host/Startup.cs index 86753d5b4..bc7690216 100644 --- a/src/NzbDrone.Host/Startup.cs +++ b/src/NzbDrone.Host/Startup.cs @@ -50,8 +50,8 @@ namespace NzbDrone.Host services.AddLogging(b => { b.ClearProviders(); - b.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); - b.AddFilter("Microsoft.AspNetCore", Microsoft.Extensions.Logging.LogLevel.Warning); + b.SetMinimumLevel(LogLevel.Trace); + b.AddFilter("Microsoft.AspNetCore", LogLevel.Warning); b.AddFilter("Radarr.Http.Authentication", LogLevel.Information); b.AddFilter("Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager", LogLevel.Error); b.AddNLog(); diff --git a/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj b/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj index f9bec7f77..b52876d1b 100644 --- a/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj +++ b/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/NzbDrone.Update/Radarr.Update.csproj b/src/NzbDrone.Update/Radarr.Update.csproj index 00d02d1eb..489f0c3c0 100644 --- a/src/NzbDrone.Update/Radarr.Update.csproj +++ b/src/NzbDrone.Update/Radarr.Update.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/NzbDrone.Windows/Radarr.Windows.csproj b/src/NzbDrone.Windows/Radarr.Windows.csproj index 855a08f8a..0c5b8ca28 100644 --- a/src/NzbDrone.Windows/Radarr.Windows.csproj +++ b/src/NzbDrone.Windows/Radarr.Windows.csproj @@ -4,7 +4,7 @@ true - + diff --git a/src/Radarr.Api.V3/Radarr.Api.V3.csproj b/src/Radarr.Api.V3/Radarr.Api.V3.csproj index b36008edb..4a25c8f6e 100644 --- a/src/Radarr.Api.V3/Radarr.Api.V3.csproj +++ b/src/Radarr.Api.V3/Radarr.Api.V3.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Radarr.Http/Radarr.Http.csproj b/src/Radarr.Http/Radarr.Http.csproj index 68f543b14..1c7991aa9 100644 --- a/src/Radarr.Http/Radarr.Http.csproj +++ b/src/Radarr.Http/Radarr.Http.csproj @@ -5,7 +5,7 @@ - +