Skip to content

Commit

Permalink
UseNLog should fallback after checking ContentRoot for NLog.config (#765
Browse files Browse the repository at this point in the history
)
  • Loading branch information
snakefoot authored Sep 23, 2024
1 parent 9106fa3 commit 8992127
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/NLog.Extensions.Hosting/Extensions/ConfigureExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ private static void TryLoadConfigurationFromContentRootPath(LogFactory logFactor
LoadXmlLoggingConfigurationFromPath(contentRootPath, $"nlog.{environmentName}.config", config.LogFactory) ??
LoadXmlLoggingConfigurationFromPath(contentRootPath, "NLog.config", config.LogFactory) ??
LoadXmlLoggingConfigurationFromPath(contentRootPath, "nlog.config", config.LogFactory);
if (nlogConfig != null)
config.Configuration = nlogConfig;
config.Configuration = nlogConfig;
}
else
{
var nlogConfig = LoadXmlLoggingConfigurationFromPath(contentRootPath, "NLog.config", config.LogFactory) ??
LoadXmlLoggingConfigurationFromPath(contentRootPath, "nlog.config", config.LogFactory);
if (nlogConfig != null)
config.Configuration = nlogConfig;
config.Configuration = nlogConfig;
}
});
}
Expand Down

0 comments on commit 8992127

Please sign in to comment.