diff --git a/src/NzbDrone.Core/HealthCheck/HealthCheckService.cs b/src/NzbDrone.Core/HealthCheck/HealthCheckService.cs index 31aa9c199..ef906ee99 100644 --- a/src/NzbDrone.Core/HealthCheck/HealthCheckService.cs +++ b/src/NzbDrone.Core/HealthCheck/HealthCheckService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using NLog; using NzbDrone.Common.Cache; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Messaging; @@ -28,6 +29,7 @@ public class HealthCheckService : IHealthCheckService, private readonly IProvideHealthCheck[] _scheduledHealthChecks; private readonly Dictionary _eventDrivenHealthChecks; private readonly IEventAggregator _eventAggregator; + private readonly Logger _logger; private readonly ICached _healthCheckResults; private readonly HashSet _pendingHealthChecks; @@ -40,10 +42,12 @@ public HealthCheckService(IEnumerable healthChecks, IEventAggregator eventAggregator, ICacheManager cacheManager, IDebounceManager debounceManager, - IRuntimeInfo runtimeInfo) + IRuntimeInfo runtimeInfo, + Logger logger) { _healthChecks = healthChecks.ToArray(); _eventAggregator = eventAggregator; + _logger = logger; _healthCheckResults = cacheManager.GetCache(GetType()); _pendingHealthChecks = new HashSet(); @@ -88,7 +92,14 @@ private void ProcessHealthChecks() try { - var results = healthChecks.Select(c => c.Check()) + var results = healthChecks.Select(c => + { + _logger.Trace("Check health -> {0}", c.GetType().Name); + var result = c.Check(); + _logger.Trace("Check health <- {0}", c.GetType().Name); + + return result; + }) .ToList(); foreach (var result in results)