diff --git a/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs b/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs
index 4a7eb726b..6bb9644a9 100644
--- a/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs
+++ b/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs
@@ -109,6 +109,13 @@ namespace NzbDrone.Core.Test.InstrumentationTests
             epFile.Path.Should().BeNull();
         }
 
+
+        [TearDown]
+        public void Teardown()
+        {
+            Mocker.Resolve<DatabaseTarget>().UnRegister();
+        }
+
         private void VerifyLog(Log logItem, LogLevel level)
         {
             logItem.Time.Should().BeWithin(TimeSpan.FromSeconds(2));
diff --git a/NzbDrone.Core/Instrumentation/DatabaseTarget.cs b/NzbDrone.Core/Instrumentation/DatabaseTarget.cs
index b39a818b3..779643240 100644
--- a/NzbDrone.Core/Instrumentation/DatabaseTarget.cs
+++ b/NzbDrone.Core/Instrumentation/DatabaseTarget.cs
@@ -3,11 +3,13 @@ using NLog.Config;
 using NLog;
 using NLog.Layouts;
 using NLog.Targets;
+using NzbDrone.Common.Messaging;
+using NzbDrone.Core.Lifecycle;
 
 namespace NzbDrone.Core.Instrumentation
 {
 
-    public class DatabaseTarget : TargetWithLayout
+    public class DatabaseTarget : TargetWithLayout, IHandle<ApplicationShutdownRequested>
     {
         private readonly ILogRepository _repository;
 
@@ -24,10 +26,23 @@ namespace NzbDrone.Core.Instrumentation
 
             LogManager.Configuration.AddTarget("DbLogger", this);
             LogManager.Configuration.LoggingRules.Add(Rule);
-            LogManager.ConfigurationReloaded += (sender, args) => Register();
+            LogManager.ConfigurationReloaded += OnLogManagerOnConfigurationReloaded;
             LogManager.ReconfigExistingLoggers();
         }
 
+        public void UnRegister()
+        {
+            LogManager.ConfigurationReloaded -= OnLogManagerOnConfigurationReloaded;
+            LogManager.Configuration.RemoveTarget("DbLogger");
+            LogManager.Configuration.LoggingRules.Remove(Rule);
+            LogManager.ReconfigExistingLoggers();
+            Dispose();
+        }
+
+        private void OnLogManagerOnConfigurationReloaded(object sender, LoggingConfigurationReloadedEventArgs args)
+        {
+            Register();
+        }
 
         public LoggingRule Rule { get; set; }
 
@@ -66,5 +81,13 @@ namespace NzbDrone.Core.Instrumentation
 
             _repository.Insert(log);
         }
+
+        public void Handle(ApplicationShutdownRequested message)
+        {
+            if (LogManager.Configuration.LoggingRules.Contains(Rule))
+            {
+                UnRegister();
+            }
+        }
     }
 }
\ No newline at end of file