mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Apparently RemoveTarget doesn't do what you expect it to do.
This commit is contained in:
parent
2487e8ed49
commit
d61976251e
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using LogentriesNLog;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
@ -61,7 +62,13 @@ public static void Register(IStartupContext startupContext, bool updateApp, bool
|
||||
|
||||
public static void UnRegisterRemoteLoggers()
|
||||
{
|
||||
LogManager.Configuration.RemoveTarget("sentryTarget");
|
||||
var sentryRules = LogManager.Configuration.LoggingRules.Where(r => r.Targets.Any(t => t.Name == "sentryTarget"));
|
||||
|
||||
foreach (var rules in sentryRules)
|
||||
{
|
||||
rules.Targets.Clear();
|
||||
}
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
}
|
||||
|
||||
@ -103,7 +110,7 @@ private static void RegisterSentry(bool updateClient)
|
||||
};
|
||||
|
||||
var loggingRule = new LoggingRule("*", updateClient ? LogLevel.Trace : LogLevel.Error, target);
|
||||
LogManager.Configuration.AddTarget("logentries", target);
|
||||
LogManager.Configuration.AddTarget("sentryTarget", target);
|
||||
LogManager.Configuration.LoggingRules.Add(loggingRule);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user