mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
manage Microsoft logs by NLog (#4080)
* now Microsoft log (Microsoft.*) are correctly supported by Nlog
* Microsoft log are now not logged under level info if tracing is not enabled.
* remove unused prefix NLog.
* Revert "Microsoft log are now not logged under level info if tracing is not enabled."
This reverts commit 00e94204e0
.
* microsoft logs in console are preserved.
Only service log is clean of microsoft logs when tracing is not enabled.
* change loglevel min to debug
* Microsoft logs can be reactivate when Enhanced logging is set to true.
* adjust min & max level of serviceMicrosoftRule
* clean Microsoft logs in all NLog targets
This commit is contained in:
@@ -140,6 +140,32 @@ namespace Jackett.Server
|
||||
{
|
||||
foreach (var rule in LogManager.Configuration.LoggingRules)
|
||||
{
|
||||
if (rule.LoggerNamePattern == "Microsoft.*")
|
||||
{
|
||||
if (!rule.Levels.Contains(LogLevel.Debug))
|
||||
{
|
||||
//don't change the first microsoftRule
|
||||
continue;
|
||||
}
|
||||
|
||||
var targets = LogManager.Configuration.ConfiguredNamedTargets;
|
||||
if (level == LogLevel.Debug)
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
rule.Targets.Add(target);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
rule.Targets.Remove(target);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (level == LogLevel.Debug)
|
||||
{
|
||||
if (!rule.Levels.Contains(LogLevel.Debug))
|
||||
|
Reference in New Issue
Block a user