1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

Reconfigure Logging early in the process to set the correct log level.

This commit is contained in:
Taloth Saldono 2016-03-22 00:10:27 +01:00
parent 8b1c022244
commit 9b42dc7082
2 changed files with 4 additions and 7 deletions

View File

@ -11,8 +11,7 @@
namespace NzbDrone.Core.Instrumentation namespace NzbDrone.Core.Instrumentation
{ {
public class ReconfigureLogging : IHandleAsync<ConfigFileSavedEvent>, public class ReconfigureLogging : IHandleAsync<ConfigFileSavedEvent>
IHandle<ApplicationStartedEvent>
{ {
private readonly IConfigFileProvider _configFileProvider; private readonly IConfigFileProvider _configFileProvider;
@ -79,10 +78,5 @@ public void HandleAsync(ConfigFileSavedEvent message)
{ {
Reconfigure(); Reconfigure();
} }
public void Handle(ApplicationStartedEvent message)
{
Reconfigure();
}
} }
} }

View File

@ -8,6 +8,7 @@
using NzbDrone.Common.Processes; using NzbDrone.Common.Processes;
using NzbDrone.Common.Security; using NzbDrone.Common.Security;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Host namespace NzbDrone.Host
{ {
@ -56,6 +57,8 @@ public static void Start(StartupContext startupContext, IUserAlert userAlert, Ac
private static void Start(ApplicationModes applicationModes, StartupContext startupContext) private static void Start(ApplicationModes applicationModes, StartupContext startupContext)
{ {
_container.Resolve<ReconfigureLogging>().Reconfigure();
if (!IsInUtilityMode(applicationModes)) if (!IsInUtilityMode(applicationModes))
{ {
if (startupContext.Flags.Contains(StartupContext.RESTART)) if (startupContext.Flags.Contains(StartupContext.RESTART))