Skip to content

Commit 4b80ba3

Browse files
committed
move loggerutil setup before first static logger usage
1 parent 4485d7b commit 4b80ba3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ServiceControl.Infrastructure/LoggingSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ public class LoggingSettings
1111
{
1212
public LoggingSettings(SettingsRootNamespace rootNamespace, LogLevel defaultLevel = LogLevel.Information, string logPath = null)
1313
{
14-
LogLevel = InitializeLogLevel(rootNamespace, defaultLevel);
15-
LogPath = SettingsReader.Read(rootNamespace, logPathKey, Environment.ExpandEnvironmentVariables(logPath ?? DefaultLogLocation()));
16-
1714
var loggingProviders = (SettingsReader.Read<string>(rootNamespace, loggingProvidersKey) ?? "").Split(",");
1815
var activeLoggers = Loggers.None;
1916
if (loggingProviders.Contains("NLog"))
@@ -26,6 +23,9 @@ public LoggingSettings(SettingsRootNamespace rootNamespace, LogLevel defaultLeve
2623
}
2724
//this defaults to NLog because historically that was the default, and we don't want to break existing installs that don't have the config key to define loggingProviders
2825
LoggerUtil.ActiveLoggers = activeLoggers == Loggers.None ? Loggers.NLog : activeLoggers;
26+
27+
LogLevel = InitializeLogLevel(rootNamespace, defaultLevel);
28+
LogPath = SettingsReader.Read(rootNamespace, logPathKey, Environment.ExpandEnvironmentVariables(logPath ?? DefaultLogLocation()));
2929
}
3030

3131
public LogLevel LogLevel { get; }

src/ServiceControl.Persistence/PersistenceManifest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Linq;
77
using System.Text.Json;
88
using Microsoft.Extensions.Logging;
9-
using NServiceBus.Logging;
109
using ServiceControl.Infrastructure;
1110

1211
public class PersistenceManifest

0 commit comments

Comments
 (0)