From 6a90035a4c11b30c2ad2894334bab88c25c137cc Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 11 Feb 2016 22:13:42 +0100 Subject: [PATCH] Updated NLog to v4.2.3. --- src/LogentriesNLog/LogentriesNLog.csproj | 6 +- src/LogentriesNLog/packages.config | 4 +- .../ErrorManagement/NzbDroneErrorPipeline.cs | 6 +- .../Extensions/Pipelines/GZipPipeline.cs | 2 +- src/NzbDrone.Api/Indexers/ReleaseModule.cs | 4 +- src/NzbDrone.Api/NzbDrone.Api.csproj | 9 +- src/NzbDrone.Api/packages.config | 2 +- .../NzbDrone.Host.Test.csproj | 7 +- src/NzbDrone.App.Test/packages.config | 2 +- .../NzbDrone.Automation.Test.csproj | 9 +- src/NzbDrone.Automation.Test/packages.config | 2 +- .../NzbDrone.Common.Test.csproj | 9 +- src/NzbDrone.Common.Test/packages.config | 2 +- src/NzbDrone.Common/Disk/DiskProviderBase.cs | 4 +- .../Disk/DiskTransferService.cs | 6 +- .../EnvironmentInfo/AppFolderFactory.cs | 2 +- .../EnvironmentInfo/RuntimeInfoBase.cs | 2 +- .../Http/Dispatchers/CurlHttpDispatcher.cs | 2 +- src/NzbDrone.Common/Http/HttpClient.cs | 2 +- src/NzbDrone.Common/Http/HttpProvider.cs | 2 +- .../GlobalExceptionHandlers.cs | 6 +- src/NzbDrone.Common/NzbDrone.Common.csproj | 7 +- .../Processes/PidFileProvider.cs | 2 +- .../Processes/ProcessProvider.cs | 2 +- src/NzbDrone.Common/TPL/TaskExtensions.cs | 2 +- src/NzbDrone.Common/packages.config | 4 +- src/NzbDrone.Console/ConsoleApp.cs | 2 +- src/NzbDrone.Console/NzbDrone.Console.csproj | 9 +- src/NzbDrone.Console/packages.config | 4 +- .../DatabaseTargetFixture.cs | 4 +- .../NzbDrone.Core.Test.csproj | 9 +- src/NzbDrone.Core.Test/packages.config | 2 +- .../DailySeries/DailySeriesDataProxy.cs | 2 +- .../Scene/SceneMappingService.cs | 2 +- .../DataAugmentation/Xem/XemService.cs | 2 +- src/NzbDrone.Core/Datastore/Database.cs | 2 +- .../Migration/Framework/MigrationLogger.cs | 2 +- .../DecisionEngine/DownloadDecisionMaker.cs | 4 +- .../DiskSpace/DiskSpaceService.cs | 2 +- .../Download/Clients/Deluge/Deluge.cs | 10 +- .../Download/Clients/NzbVortex/NzbVortex.cs | 4 +- .../Download/Clients/Nzbget/Nzbget.cs | 6 +- .../Download/Clients/Sabnzbd/Sabnzbd.cs | 4 +- .../Clients/Transmission/Transmission.cs | 10 +- .../Clients/qBittorrent/QBittorrent.cs | 10 +- .../Download/Clients/rTorrent/RTorrent.cs | 6 +- .../Download/Clients/uTorrent/UTorrent.cs | 10 +- .../Download/DownloadClientBase.cs | 4 +- .../Download/DownloadEventHub.cs | 2 +- .../Download/ProcessDownloadDecisions.cs | 2 +- .../Download/TorrentClientBase.cs | 9 +- .../DownloadMonitoringService.cs | 4 +- .../TrackedDownloadService.cs | 2 +- .../Download/UsenetClientBase.cs | 6 +- .../HealthCheck/Checks/DownloadClientCheck.cs | 2 +- .../Housekeepers/DeleteBadMediaCovers.cs | 2 +- .../Housekeeping/HousekeepingService.cs | 2 +- .../IndexerSearch/EpisodeSearchService.cs | 4 +- .../IndexerSearch/NzbSearchService.cs | 2 +- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 10 +- src/NzbDrone.Core/Indexers/IndexerBase.cs | 2 +- src/NzbDrone.Core/Indexers/Newznab/Newznab.cs | 2 +- .../Newznab/NewznabCapabilitiesProvider.cs | 2 +- src/NzbDrone.Core/Indexers/RssParser.cs | 4 +- .../TorrentRss/TorrentRssSettingsDetector.cs | 6 +- src/NzbDrone.Core/Indexers/Torznab/Torznab.cs | 4 +- .../Indexers/XElementExtensions.cs | 2 +- .../MediaCover/MediaCoverService.cs | 2 +- .../MediaFiles/DiskScanService.cs | 4 +- .../MediaFiles/EpisodeFileMovingService.cs | 4 +- .../EpisodeImport/ImportApprovedEpisodes.cs | 2 +- .../EpisodeImport/ImportDecisionMaker.cs | 4 +- .../Specifications/FreeSpaceSpecification.cs | 2 +- .../MediaFiles/MediaFileAttributeService.cs | 8 +- .../MediaFileTableCleanupService.cs | 2 +- .../MediaInfo/VideoFileInfoReader.cs | 4 +- .../MediaFiles/RecycleBinProvider.cs | 2 +- .../MediaFiles/RenameEpisodeFileService.cs | 2 +- .../MediaFiles/UpdateEpisodeFileService.cs | 4 +- .../Messaging/Commands/CommandExecutor.cs | 6 +- .../Messaging/Events/EventAggregator.cs | 2 +- .../Metadata/Consumers/Xbmc/XbmcMetadata.cs | 2 +- src/NzbDrone.Core/Metadata/MetadataService.cs | 2 +- .../MetadataSource/SkyHook/SkyHookProxy.cs | 2 +- .../Notifications/Boxcar/BoxcarProxy.cs | 10 +- .../Notifications/Email/EmailService.cs | 6 +- .../Notifications/Growl/GrowlService.cs | 2 +- .../MediaBrowser/MediaBrowserService.cs | 2 +- .../Notifications/NotificationService.cs | 6 +- .../NotifyMyAndroid/NotifyMyAndroidProxy.cs | 2 +- .../Notifications/Plex/PlexClientService.cs | 4 +- .../Notifications/Plex/PlexHomeTheater.cs | 2 +- .../Notifications/Plex/PlexServerService.cs | 8 +- .../Notifications/Prowl/ProwlService.cs | 6 +- .../PushBullet/PushBulletProxy.cs | 14 +- .../Notifications/Pushalot/PushalotProxy.cs | 10 +- .../Notifications/Pushover/PushoverService.cs | 2 +- .../Synology/SynologyIndexerProxy.cs | 2 +- .../Notifications/Twitter/TwitterService.cs | 2 +- .../Notifications/Xbmc/HttpApiProvider.cs | 4 +- .../Notifications/Xbmc/JsonApiProvider.cs | 2 +- src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs | 4 +- .../Notifications/Xbmc/XbmcService.cs | 2 +- src/NzbDrone.Core/NzbDrone.Core.csproj | 9 +- src/NzbDrone.Core/Parser/Parser.cs | 4 +- src/NzbDrone.Core/Rest/RestSharpExtensions.cs | 2 +- .../RootFolders/RootFolderService.cs | 2 +- src/NzbDrone.Core/Tv/MoveSeriesService.cs | 2 +- src/NzbDrone.Core/Tv/RefreshEpisodeService.cs | 2 +- src/NzbDrone.Core/Tv/RefreshSeriesService.cs | 6 +- .../Update/InstallUpdateService.cs | 8 +- src/NzbDrone.Core/packages.config | 2 +- .../AccessControl/FirewallAdapter.cs | 6 +- .../AccessControl/NetshProvider.cs | 2 +- src/NzbDrone.Host/BrowserService.cs | 2 +- src/NzbDrone.Host/NLog.xsd | 2638 ----------------- src/NzbDrone.Host/NzbDrone.Host.csproj | 12 +- src/NzbDrone.Host/SingleInstancePolicy.cs | 2 +- src/NzbDrone.Host/packages.config | 5 +- .../NzbDrone.Integration.Test.csproj | 9 +- src/NzbDrone.Integration.Test/packages.config | 2 +- src/NzbDrone.Mono/DiskProvider.cs | 6 +- src/NzbDrone.Mono/MonoRuntimeProvider.cs | 2 +- src/NzbDrone.Mono/NzbDrone.Mono.csproj | 8 +- src/NzbDrone.Mono/ProcMountProvider.cs | 4 +- src/NzbDrone.Mono/SymbolicLinkResolver.cs | 2 +- src/NzbDrone.Mono/packages.config | 2 +- .../NzbDrone.Test.Common.csproj | 7 +- src/NzbDrone.Test.Common/packages.config | 2 +- .../NzbDrone.Update.Test.csproj | 9 +- src/NzbDrone.Update.Test/packages.config | 2 +- src/NzbDrone.Update/NLog.xsd | 2638 ----------------- src/NzbDrone.Update/NzbDrone.Update.csproj | 12 +- src/NzbDrone.Update/UpdateApp.cs | 2 +- .../UpdateEngine/BackupAppData.cs | 2 +- .../UpdateEngine/InstallUpdateService.cs | 2 +- .../UpdateEngine/TerminateNzbDrone.cs | 2 +- src/NzbDrone.Update/packages.config | 3 +- src/NzbDrone.Windows/DiskProvider.cs | 2 +- src/NzbDrone.Windows/NzbDrone.Windows.csproj | 15 +- src/NzbDrone.Windows/packages.config | 2 +- src/NzbDrone/NzbDrone.csproj | 9 +- src/NzbDrone/WindowsApp.cs | 2 +- src/NzbDrone/packages.config | 4 +- 144 files changed, 305 insertions(+), 5579 deletions(-) delete mode 100644 src/NzbDrone.Host/NLog.xsd delete mode 100644 src/NzbDrone.Update/NLog.xsd diff --git a/src/LogentriesNLog/LogentriesNLog.csproj b/src/LogentriesNLog/LogentriesNLog.csproj index d6cc72849..f6e3c5800 100644 --- a/src/LogentriesNLog/LogentriesNLog.csproj +++ b/src/LogentriesNLog/LogentriesNLog.csproj @@ -51,8 +51,9 @@ MinimumRecommendedRules.ruleset - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True @@ -79,6 +80,7 @@ + diff --git a/src/LogentriesNLog/packages.config b/src/LogentriesNLog/packages.config index 308a3fc74..6645420b9 100644 --- a/src/LogentriesNLog/packages.config +++ b/src/LogentriesNLog/packages.config @@ -1,4 +1,4 @@  - - + + \ No newline at end of file diff --git a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs index a3195ff4a..f65473cf0 100644 --- a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs +++ b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Api.ErrorManagement if (apiException != null) { - _logger.WarnException("API Error", apiException); + _logger.Warn(apiException, "API Error"); return apiException.ToErrorResponse(); } @@ -65,10 +65,10 @@ namespace NzbDrone.Api.ErrorManagement var sqlErrorMessage = string.Format("[{0} {1}]", context.Request.Method, context.Request.Path); - _logger.ErrorException(sqlErrorMessage, sqLiteException); + _logger.Error(sqLiteException, sqlErrorMessage); } - _logger.FatalException("Request Failed", exception); + _logger.Fatal(exception, "Request Failed"); return new ErrorModel { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs index a671d1f02..1b9013686 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs @@ -60,7 +60,7 @@ namespace NzbDrone.Api.Extensions.Pipelines catch (Exception ex) { - _logger.ErrorException("Unable to gzip response", ex); + _logger.Error(ex, "Unable to gzip response"); throw; } } diff --git a/src/NzbDrone.Api/Indexers/ReleaseModule.cs b/src/NzbDrone.Api/Indexers/ReleaseModule.cs index ddbf8fb32..9b87f7642 100644 --- a/src/NzbDrone.Api/Indexers/ReleaseModule.cs +++ b/src/NzbDrone.Api/Indexers/ReleaseModule.cs @@ -68,7 +68,7 @@ namespace NzbDrone.Api.Indexers } catch (ReleaseDownloadException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed"); } @@ -96,7 +96,7 @@ namespace NzbDrone.Api.Indexers } catch (Exception ex) { - _logger.ErrorException("Episode search failed: " + ex.Message, ex); + _logger.Error(ex, "Episode search failed: " + ex.Message); } return new List(); diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index 4dbb4aadd..21e64aff3 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -59,6 +59,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + @@ -66,9 +70,6 @@ ..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll @@ -278,4 +279,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Api/packages.config b/src/NzbDrone.Api/packages.config index d1151e972..64838fddf 100644 --- a/src/NzbDrone.Api/packages.config +++ b/src/NzbDrone.Api/packages.config @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj b/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj index 3033e4af6..1e9331925 100644 --- a/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj +++ b/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj @@ -45,6 +45,10 @@ ..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll True + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -60,9 +64,6 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - diff --git a/src/NzbDrone.App.Test/packages.config b/src/NzbDrone.App.Test/packages.config index fbfd4be97..d2ca2334f 100644 --- a/src/NzbDrone.App.Test/packages.config +++ b/src/NzbDrone.App.Test/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj index e9e7c5a3d..de3707f40 100644 --- a/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj +++ b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj @@ -46,6 +46,10 @@ ..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll True + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -58,9 +62,6 @@ - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - False ..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll @@ -102,4 +103,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/packages.config b/src/NzbDrone.Automation.Test/packages.config index ff7785d92..8ec9ba418 100644 --- a/src/NzbDrone.Automation.Test/packages.config +++ b/src/NzbDrone.Automation.Test/packages.config @@ -1,7 +1,7 @@  - + diff --git a/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj b/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj index a906d5411..cfc284f3a 100644 --- a/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj +++ b/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj @@ -45,6 +45,10 @@ ..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll True + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -60,9 +64,6 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - @@ -151,4 +152,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Common.Test/packages.config b/src/NzbDrone.Common.Test/packages.config index db662bb41..0f636dbe2 100644 --- a/src/NzbDrone.Common.Test/packages.config +++ b/src/NzbDrone.Common.Test/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index 5155d3ea5..a241cf9d4 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -304,7 +304,7 @@ namespace NzbDrone.Common.Disk } catch (Exception e) { - Logger.WarnException(string.Format("Couldn't set permission for {0}. account:{1} rights:{2} accessControlType:{3}", filename, accountSid, rights, controlType), e); + Logger.Warn(e, string.Format("Couldn't set permission for {0}. account:{1} rights:{2} accessControlType:{3}", filename, accountSid, rights, controlType)); throw; } @@ -394,7 +394,7 @@ namespace NzbDrone.Common.Disk } catch (Exception ex) { - Logger.DebugException(string.Format("Failed to get mount for path {0}", path), ex); + Logger.Debug(ex, string.Format("Failed to get mount for path {0}", path)); return null; } } diff --git a/src/NzbDrone.Common/Disk/DiskTransferService.cs b/src/NzbDrone.Common/Disk/DiskTransferService.cs index 77b3fbdf8..257dc1d22 100644 --- a/src/NzbDrone.Common/Disk/DiskTransferService.cs +++ b/src/NzbDrone.Common/Disk/DiskTransferService.cs @@ -259,7 +259,7 @@ namespace NzbDrone.Common.Disk } catch (Exception ex) { - _logger.ErrorException(string.Format("Failed to properly rollback the file move [{0}] to [{1}], incomplete file may be left in target path.", sourcePath, targetPath), ex); + _logger.Error(ex, string.Format("Failed to properly rollback the file move [{0}] to [{1}], incomplete file may be left in target path.", sourcePath, targetPath)); } } @@ -275,7 +275,7 @@ namespace NzbDrone.Common.Disk } catch (Exception ex) { - _logger.ErrorException(string.Format("Failed to properly rollback the file move [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath), ex); + _logger.Error(ex, string.Format("Failed to properly rollback the file move [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath)); } } @@ -294,7 +294,7 @@ namespace NzbDrone.Common.Disk } catch (Exception ex) { - _logger.ErrorException(string.Format("Failed to properly rollback the file copy [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath), ex); + _logger.Error(ex, string.Format("Failed to properly rollback the file copy [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath)); } } diff --git a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs index 55ae2319d..c1632f8bc 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Common.EnvironmentInfo } catch (Exception ex) { - _logger.WarnException("Coudn't set app folder permission", ex); + _logger.Warn(ex, "Coudn't set app folder permission"); } } } diff --git a/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs b/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs index c2c394e47..04be4e8f0 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs @@ -60,7 +60,7 @@ namespace NzbDrone.Common.EnvironmentInfo } catch (Exception ex) { - _logger.WarnException("Error checking if the current user is an administrator.", ex); + _logger.Warn(ex, "Error checking if the current user is an administrator."); return false; } } diff --git a/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs b/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs index 35a4dfc54..8346ac4d7 100644 --- a/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs +++ b/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Common.Http.Dispatchers } catch (Exception ex) { - _logger.TraceException("Initializing curl failed", ex); + _logger.Trace(ex, "Initializing curl failed"); return false; } } diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index de36b60fe..dc3dc7fed 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -177,7 +177,7 @@ namespace NzbDrone.Common.Http } catch (Exception e) { - _logger.WarnException("Failed to get response from: " + url, e); + _logger.Warn(e, "Failed to get response from: " + url); throw; } } diff --git a/src/NzbDrone.Common/Http/HttpProvider.cs b/src/NzbDrone.Common/Http/HttpProvider.cs index 2f47a1361..e09fbf1c6 100644 --- a/src/NzbDrone.Common/Http/HttpProvider.cs +++ b/src/NzbDrone.Common/Http/HttpProvider.cs @@ -53,7 +53,7 @@ namespace NzbDrone.Common.Http } catch (Exception e) { - _logger.WarnException("Failed to get response from: " + url, e); + _logger.Warn(e, "Failed to get response from: " + url); throw; } } diff --git a/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs b/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs index b490757fb..93f66ca6d 100644 --- a/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs +++ b/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Common.Instrumentation var exception = e.Exception; Console.WriteLine("Task Error: {0}", exception); - Logger.ErrorException("Task Error: " + exception.Message, exception); + Logger.Error(exception, "Task Error: " + exception.Message); } private static void HandleAppDomainException(object sender, UnhandledExceptionEventArgs e) @@ -40,13 +40,13 @@ namespace NzbDrone.Common.Instrumentation if (exception is TypeInitializationException && exception.InnerException is DllNotFoundException || exception is DllNotFoundException) { - Logger.DebugException("Minor Fail: " + exception.Message, exception); + Logger.Debug(exception, "Minor Fail: " + exception.Message); return; } } Console.WriteLine("EPIC FAIL: {0}", exception); - Logger.FatalException("EPIC FAIL: " + exception.Message, exception); + Logger.Fatal(exception, "EPIC FAIL: " + exception.Message); } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/NzbDrone.Common.csproj b/src/NzbDrone.Common/NzbDrone.Common.csproj index d8b3478f4..098a02b1d 100644 --- a/src/NzbDrone.Common/NzbDrone.Common.csproj +++ b/src/NzbDrone.Common/NzbDrone.Common.csproj @@ -43,6 +43,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + @@ -53,9 +57,6 @@ ..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - diff --git a/src/NzbDrone.Common/Processes/PidFileProvider.cs b/src/NzbDrone.Common/Processes/PidFileProvider.cs index eacf8b560..17e781225 100644 --- a/src/NzbDrone.Common/Processes/PidFileProvider.cs +++ b/src/NzbDrone.Common/Processes/PidFileProvider.cs @@ -37,7 +37,7 @@ namespace NzbDrone.Common.Processes } catch (Exception ex) { - _logger.ErrorException("Unable to write PID file: " + filename, ex); + _logger.Error(ex, "Unable to write PID file: " + filename); throw; } } diff --git a/src/NzbDrone.Common/Processes/ProcessProvider.cs b/src/NzbDrone.Common/Processes/ProcessProvider.cs index 9c80123b1..57068c840 100644 --- a/src/NzbDrone.Common/Processes/ProcessProvider.cs +++ b/src/NzbDrone.Common/Processes/ProcessProvider.cs @@ -292,7 +292,7 @@ namespace NzbDrone.Common.Processes } catch (Win32Exception e) { - _logger.WarnException("Couldn't get process info for " + process.ProcessName, e); + _logger.Warn(e, "Couldn't get process info for " + process.ProcessName); } return processInfo; diff --git a/src/NzbDrone.Common/TPL/TaskExtensions.cs b/src/NzbDrone.Common/TPL/TaskExtensions.cs index da6507ee1..aea8f3a11 100644 --- a/src/NzbDrone.Common/TPL/TaskExtensions.cs +++ b/src/NzbDrone.Common/TPL/TaskExtensions.cs @@ -17,7 +17,7 @@ namespace NzbDrone.Common.TPL var aggregateException = t.Exception.Flatten(); foreach (var exception in aggregateException.InnerExceptions) { - Logger.ErrorException("Task Error", exception); + Logger.Error(exception, "Task Error"); } } }, TaskContinuationOptions.OnlyOnFaulted); diff --git a/src/NzbDrone.Common/packages.config b/src/NzbDrone.Common/packages.config index 7c0794d3c..a75d31eac 100644 --- a/src/NzbDrone.Common/packages.config +++ b/src/NzbDrone.Common/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/src/NzbDrone.Console/ConsoleApp.cs b/src/NzbDrone.Console/ConsoleApp.cs index 6c8bfd636..f13392149 100644 --- a/src/NzbDrone.Console/ConsoleApp.cs +++ b/src/NzbDrone.Console/ConsoleApp.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Console { System.Console.WriteLine(""); System.Console.WriteLine(""); - Logger.FatalException("EPIC FAIL!", e); + Logger.Fatal(e, "EPIC FAIL!"); System.Console.WriteLine("Press any key to exit..."); System.Console.ReadLine(); Environment.Exit(1); diff --git a/src/NzbDrone.Console/NzbDrone.Console.csproj b/src/NzbDrone.Console/NzbDrone.Console.csproj index 8475f5661..cdc632c40 100644 --- a/src/NzbDrone.Console/NzbDrone.Console.csproj +++ b/src/NzbDrone.Console/NzbDrone.Console.csproj @@ -75,11 +75,12 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -150,4 +151,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Console/packages.config b/src/NzbDrone.Console/packages.config index e4fc59a0b..9a1a2a3f1 100644 --- a/src/NzbDrone.Console/packages.config +++ b/src/NzbDrone.Console/packages.config @@ -3,6 +3,6 @@ - + - + \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs index 6ca20475c..74b777028 100644 --- a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs +++ b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs @@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.InstrumentationTests { var ex = new InvalidOperationException("Fake Exception"); - _logger.ErrorException(_uniqueMessage, ex); + _logger.Error(ex, _uniqueMessage); VerifyLog(StoredModel, LogLevel.Error); @@ -102,7 +102,7 @@ namespace NzbDrone.Core.Test.InstrumentationTests _uniqueMessage = string.Empty; - _logger.ErrorException(_uniqueMessage, ex); + _logger.Error(ex, _uniqueMessage); StoredModel.Message.Should().Be(ex.Message); diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 4210c8171..b7845a57a 100644 --- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -68,6 +68,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -96,9 +100,6 @@ ..\packages\NCrunch.Framework.1.46.0.9\lib\net35\NCrunch.Framework.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll @@ -554,4 +555,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/packages.config b/src/NzbDrone.Core.Test/packages.config index a3d44baa7..767208bbe 100644 --- a/src/NzbDrone.Core.Test/packages.config +++ b/src/NzbDrone.Core.Test/packages.config @@ -10,7 +10,7 @@ - + diff --git a/src/NzbDrone.Core/DataAugmentation/DailySeries/DailySeriesDataProxy.cs b/src/NzbDrone.Core/DataAugmentation/DailySeries/DailySeriesDataProxy.cs index 9a432144e..49d32b101 100644 --- a/src/NzbDrone.Core/DataAugmentation/DailySeries/DailySeriesDataProxy.cs +++ b/src/NzbDrone.Core/DataAugmentation/DailySeries/DailySeriesDataProxy.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries } catch (Exception ex) { - _logger.WarnException("Failed to get Daily Series", ex); + _logger.Warn(ex, "Failed to get Daily Series"); return new List(); } } diff --git a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs index a7f5c318a..f8b3a20bc 100644 --- a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs @@ -139,7 +139,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene } catch (Exception ex) { - _logger.ErrorException("Failed to Update Scene Mappings:", ex); + _logger.Error(ex, "Failed to Update Scene Mappings:"); } } diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs index 29e17a351..591f5c9a0 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs @@ -84,7 +84,7 @@ namespace NzbDrone.Core.DataAugmentation.Xem } catch (Exception ex) { - _logger.ErrorException("Error updating scene numbering mappings for: " + series, ex); + _logger.Error(ex, "Error updating scene numbering mappings for: " + series); } } diff --git a/src/NzbDrone.Core/Datastore/Database.cs b/src/NzbDrone.Core/Datastore/Database.cs index f8ac9bd53..c4e59f983 100644 --- a/src/NzbDrone.Core/Datastore/Database.cs +++ b/src/NzbDrone.Core/Datastore/Database.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Datastore } catch (Exception e) { - _logger.ErrorException("An Error occurred while vacuuming database.", e); + _logger.Error(e, "An Error occurred while vacuuming database."); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs index acdb0d0b3..97201abee 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs @@ -47,7 +47,7 @@ namespace NzbDrone.Core.Datastore.Migration.Framework public void Error(Exception exception) { - _logger.ErrorException(exception.Message, exception); + _logger.Error(exception, exception.Message); } public void Write(string message, bool escaped) diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index cc9c1f59a..c702e60bd 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -95,7 +95,7 @@ namespace NzbDrone.Core.DecisionEngine } catch (Exception e) { - _logger.ErrorException("Couldn't process release.", e); + _logger.Error(e, "Couldn't process release."); } reportNumber++; @@ -140,7 +140,7 @@ namespace NzbDrone.Core.DecisionEngine { e.Data.Add("report", remoteEpisode.Release.ToJson()); e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); - _logger.ErrorException("Couldn't evaluate decision on " + remoteEpisode.Release.Title, e); + _logger.Error(e, "Couldn't evaluate decision on " + remoteEpisode.Release.Title); return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); } diff --git a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs index 2d925ee08..69e8af676 100644 --- a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs +++ b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs @@ -91,7 +91,7 @@ namespace NzbDrone.Core.DiskSpace { if (!suppressWarnings) { - _logger.WarnException("Unable to get free space for: " + path, ex); + _logger.Warn(ex, "Unable to get free space for: " + path); } } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index dd83cd4d9..6d2b81cba 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -204,12 +204,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge } catch (DownloadClientAuthenticationException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure("Password", "Authentication failed"); } catch (WebException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); switch (ex.Status) { case WebExceptionStatus.ConnectFailure: @@ -233,7 +233,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -284,7 +284,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index 575736f44..eef799364 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -172,7 +172,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new ValidationFailure("Host", "Unable to connect to NZBVortex"); } @@ -193,7 +193,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new ValidationFailure("Host", "Unable to connect to NZBVortex"); } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 9e689c94b..15fe53a67 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -120,7 +120,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -284,7 +284,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { return new ValidationFailure("Username", "Authentication failed"); } - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new ValidationFailure("Host", "Unable to connect to NZBGet"); } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index f1673775b..f35a71a2e 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -107,7 +107,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -267,7 +267,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new ValidationFailure("Host", "Unable to connect to SABnzbd"); } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs index 67715fdf0..3c4b2b1d1 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -218,7 +218,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission } catch (DownloadClientAuthenticationException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = "Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing Transmission by WhiteList limitations in the Transmission configuration." @@ -226,7 +226,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission } catch (WebException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -238,7 +238,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -253,7 +253,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs index fb48c090b..61e88bc7e 100644 --- a/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs @@ -98,7 +98,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -230,7 +230,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent } catch (DownloadClientAuthenticationException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = "Please verify your username and password." @@ -238,7 +238,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent } catch (WebException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -250,7 +250,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); } @@ -265,7 +265,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs index 5c3f1c4b4..58b0f15c6 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs @@ -159,7 +159,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -208,7 +208,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -223,7 +223,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 8979436fd..64888a4bd 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -81,7 +81,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent } catch (DownloadClientException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return Enumerable.Empty(); } @@ -208,7 +208,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent } catch (DownloadClientAuthenticationException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = "Please verify your username and password." @@ -216,7 +216,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent } catch (WebException ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -228,7 +228,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -243,7 +243,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent } catch (Exception ex) { - _logger.ErrorException(ex.Message, ex); + _logger.Error(ex, ex.Message); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/DownloadClientBase.cs b/src/NzbDrone.Core/Download/DownloadClientBase.cs index 324073b82..d8d80479a 100644 --- a/src/NzbDrone.Core/Download/DownloadClientBase.cs +++ b/src/NzbDrone.Core/Download/DownloadClientBase.cs @@ -127,7 +127,7 @@ namespace NzbDrone.Core.Download } catch (Exception ex) { - _logger.WarnException(string.Format("[{0}] Error occurred while trying to delete data from '{1}'.", item.Title, item.OutputPath), ex); + _logger.Warn(ex, string.Format("[{0}] Error occurred while trying to delete data from '{1}'.", item.Title, item.OutputPath)); } } @@ -141,7 +141,7 @@ namespace NzbDrone.Core.Download } catch (Exception ex) { - _logger.ErrorException("Test aborted due to exception", ex); + _logger.Error(ex, "Test aborted due to exception"); failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message)); } diff --git a/src/NzbDrone.Core/Download/DownloadEventHub.cs b/src/NzbDrone.Core/Download/DownloadEventHub.cs index e534aa7c2..6d910292c 100644 --- a/src/NzbDrone.Core/Download/DownloadEventHub.cs +++ b/src/NzbDrone.Core/Download/DownloadEventHub.cs @@ -74,7 +74,7 @@ namespace NzbDrone.Core.Download } catch (Exception e) { - _logger.ErrorException("Couldn't remove item from client " + trackedDownload.DownloadItem.Title, e); + _logger.Error(e, "Couldn't remove item from client " + trackedDownload.DownloadItem.Title); } } } diff --git a/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs b/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs index 09fcfb8aa..05719587d 100644 --- a/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs +++ b/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs @@ -78,7 +78,7 @@ namespace NzbDrone.Core.Download { //TODO: support for store & forward //We'll need to differentiate between a download client error and an indexer error - _logger.WarnException("Couldn't add report to download queue. " + remoteEpisode, e); + _logger.Warn(e, "Couldn't add report to download queue. " + remoteEpisode); } } diff --git a/src/NzbDrone.Core/Download/TorrentClientBase.cs b/src/NzbDrone.Core/Download/TorrentClientBase.cs index dd2e93b52..d457ed816 100644 --- a/src/NzbDrone.Core/Download/TorrentClientBase.cs +++ b/src/NzbDrone.Core/Download/TorrentClientBase.cs @@ -130,15 +130,13 @@ namespace NzbDrone.Core.Download } catch (HttpException ex) { - _logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", - remoteEpisode.Release.Title, torrentUrl), ex); + _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } catch (WebException ex) { - _logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", - remoteEpisode.Release.Title, torrentUrl), ex); + _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } @@ -168,8 +166,7 @@ namespace NzbDrone.Core.Download } catch (FormatException ex) { - _logger.ErrorException(string.Format("Failed to parse magnetlink for episode '{0}': '{1}'", - remoteEpisode.Release.Title, magnetUrl), ex); + _logger.Error(ex, "Failed to parse magnetlink for episode '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl); return null; } diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs index f708e7976..cf9124d19 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads } catch (Exception ex) { - _logger.WarnException("Unable to retrieve queue and history items from " + downloadClient.Definition.Name, ex); + _logger.Warn(ex, "Unable to retrieve queue and history items from " + downloadClient.Definition.Name); } foreach (var downloadItem in downloadClientHistory) @@ -135,7 +135,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads } catch (Exception e) { - _logger.ErrorException("Couldn't process tracked download " + downloadItem.Title, e); + _logger.Error(e, "Couldn't process tracked download " + downloadItem.Title); } return trackedDownloads; diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index 96dca27cd..213607631 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -93,7 +93,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads } catch (Exception e) { - _logger.DebugException("Failed to find episode for " + downloadItem.Title, e); + _logger.Debug(e, "Failed to find episode for " + downloadItem.Title); return null; } diff --git a/src/NzbDrone.Core/Download/UsenetClientBase.cs b/src/NzbDrone.Core/Download/UsenetClientBase.cs index d6bf5b42a..6dcd2fde8 100644 --- a/src/NzbDrone.Core/Download/UsenetClientBase.cs +++ b/src/NzbDrone.Core/Download/UsenetClientBase.cs @@ -53,15 +53,13 @@ namespace NzbDrone.Core.Download } catch (HttpException ex) { - _logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", - remoteEpisode.Release.Title, url), ex); + _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); } catch (WebException ex) { - _logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", - remoteEpisode.Release.Title, url), ex); + _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs index 8de03222b..f82e37e1b 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.HealthCheck.Checks { var message = String.Format("Unable to communicate with {0}.", downloadClient.Definition.Name); - _logger.ErrorException(message, ex); + _logger.Error(ex, message); return new HealthCheck(GetType(), HealthCheckResult.Error, message + " " + ex.Message); } } diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs index 4192504f8..d1c944d6b 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers } catch (Exception e) { - _logger.ErrorException("Couldn't validate image " + image.RelativePath, e); + _logger.Error(e, "Couldn't validate image " + image.RelativePath); } } } diff --git a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs index b27bd0ced..d9229ba64 100644 --- a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs +++ b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs @@ -37,7 +37,7 @@ namespace NzbDrone.Core.Housekeeping } catch (Exception ex) { - _logger.ErrorException("Error running housekeeping task: " + housekeeper.GetType().Name, ex); + _logger.Error(ex, "Error running housekeeping task: " + housekeeper.GetType().Name); } } diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs index 0fb296d12..752f794ad 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs @@ -57,7 +57,7 @@ namespace NzbDrone.Core.IndexerSearch catch (Exception ex) { var message = String.Format("Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key); - _logger.ErrorException(message, ex); + _logger.Error(ex, message); continue; } } @@ -71,7 +71,7 @@ namespace NzbDrone.Core.IndexerSearch catch (Exception ex) { var message = String.Format("Unable to search for missing episode: [{0}]", season.First()); - _logger.ErrorException(message, ex); + _logger.Error(ex, message); continue; } } diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index dcb713b2a..ede53205d 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -272,7 +272,7 @@ namespace NzbDrone.Core.IndexerSearch } catch (Exception e) { - _logger.ErrorException("Error while searching for " + criteriaBase, e); + _logger.Error(e, "Error while searching for " + criteriaBase); } }).LogExceptions()); } diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index ad89cf3c7..9b645de5e 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -249,13 +249,13 @@ namespace NzbDrone.Core.Indexers { _indexerStatusService.RecordFailure(Definition.Id); var message = string.Format("{0} - {1}", ex.Message, url); - _logger.WarnException(message, ex); + _logger.Warn(ex, message); } catch (Exception feedEx) { _indexerStatusService.RecordFailure(Definition.Id); feedEx.Data.Add("FeedUrl", url); - _logger.ErrorException("An error occurred while processing feed. " + url, feedEx); + _logger.Error(feedEx, "An error occurred while processing feed. " + url); } return CleanupReleases(releases); @@ -315,19 +315,19 @@ namespace NzbDrone.Core.Indexers } catch (UnsupportedFeedException ex) { - _logger.WarnException("Indexer feed is not supported", ex); + _logger.Warn(ex, "Indexer feed is not supported"); return new ValidationFailure(string.Empty, "Indexer feed is not supported: " + ex.Message); } catch (IndexerException ex) { - _logger.WarnException("Unable to connect to indexer", ex); + _logger.Warn(ex, "Unable to connect to indexer"); return new ValidationFailure(string.Empty, "Unable to connect to indexer. " + ex.Message); } catch (Exception ex) { - _logger.WarnException("Unable to connect to indexer", ex); + _logger.Warn(ex, "Unable to connect to indexer"); return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); } diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index 3c8f130ab..16bcc6870 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -106,7 +106,7 @@ namespace NzbDrone.Core.Indexers } catch (Exception ex) { - _logger.ErrorException("Test aborted due to exception", ex); + _logger.Error(ex, "Test aborted due to exception"); failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message)); } diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index a79f41587..2867fa5ce 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -120,7 +120,7 @@ namespace NzbDrone.Core.Indexers.Newznab } catch (Exception ex) { - _logger.WarnException("Unable to connect to indexer: " + ex.Message, ex); + _logger.Warn(ex, "Unable to connect to indexer: " + ex.Message); return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); } diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs index 8ba76ce14..a27641064 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Indexers.Newznab } catch (Exception ex) { - _logger.DebugException(string.Format("Failed to get capabilities from {0}: {1}", indexerSettings.Url, ex.Message), ex); + _logger.Debug(ex, string.Format("Failed to get capabilities from {0}: {1}", indexerSettings.Url, ex.Message)); } return capabilities; diff --git a/src/NzbDrone.Core/Indexers/RssParser.cs b/src/NzbDrone.Core/Indexers/RssParser.cs index c78c67094..e4b785622 100644 --- a/src/NzbDrone.Core/Indexers/RssParser.cs +++ b/src/NzbDrone.Core/Indexers/RssParser.cs @@ -63,7 +63,7 @@ namespace NzbDrone.Core.Indexers catch (Exception itemEx) { itemEx.Data.Add("Item", item.Title()); - _logger.ErrorException("An error occurred while processing feed item from " + indexerResponse.Request.Url, itemEx); + _logger.Error(itemEx, "An error occurred while processing feed item from " + indexerResponse.Request.Url); } } @@ -277,7 +277,7 @@ namespace NzbDrone.Core.Indexers } catch (Exception ex) { - _logger.DebugException(string.Format("Failed to parse Uri {0}, ignoring.", value), ex); + _logger.Debug(ex, string.Format("Failed to parse Uri {0}, ignoring.", value)); return null; } } diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs index a74c0c687..919254abe 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss } catch (Exception ex) { - _logger.WarnException(string.Format("Unable to connect to indexer {0}: {1}", request.Url, ex.Message), ex); + _logger.Warn(ex, string.Format("Unable to connect to indexer {0}: {1}", request.Url, ex.Message)); return null; } @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss } catch (Exception ex) { - _logger.TraceException("Feed wasn't parsable by Ezrss Parser", ex); + _logger.Trace(ex, "Feed wasn't parsable by Ezrss Parser"); return null; } } @@ -233,7 +233,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss } catch (Exception ex) { - _logger.DebugException("Unable to parse indexer feed: " + ex.Message, ex); + _logger.Debug(ex, "Unable to parse indexer feed: " + ex.Message); throw new UnsupportedFeedException("Unable to parse indexer: " + ex.Message); } } diff --git a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs index cfeb5e6c6..6ae609248 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs @@ -111,12 +111,10 @@ namespace NzbDrone.Core.Indexers.Torznab } catch (Exception ex) { - _logger.WarnException("Unable to connect to indexer: " + ex.Message, ex); + _logger.Warn(ex, "Unable to connect to indexer: " + ex.Message); return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); } - - return null; } } } diff --git a/src/NzbDrone.Core/Indexers/XElementExtensions.cs b/src/NzbDrone.Core/Indexers/XElementExtensions.cs index bd0b6b32a..72da2790d 100644 --- a/src/NzbDrone.Core/Indexers/XElementExtensions.cs +++ b/src/NzbDrone.Core/Indexers/XElementExtensions.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers } catch (FormatException e) { - Logger.WarnException("Unable to parse " + dateString, e); + Logger.Warn(e, "Unable to parse " + dateString); throw; } } diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs index 446865425..deb2b35a5 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -103,7 +103,7 @@ namespace NzbDrone.Core.MediaCover } catch (Exception e) { - _logger.ErrorException("Couldn't download media cover for " + series, e); + _logger.Error(e, "Couldn't download media cover for " + series); } EnsureResizedCovers(series, cover, !alreadyExists); diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index 82c5822aa..a1e8eb1a4 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -155,8 +155,8 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { - _logger.WarnException("Unable to apply permissions to: " + path, ex); - _logger.DebugException(ex.Message, ex); + _logger.Warn(ex, "Unable to apply permissions to: " + path); + _logger.Debug(ex, ex.Message); } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index 72f12fb3f..781d6e4cf 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -135,7 +135,7 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { - _logger.WarnException("Unable to set last write time", ex); + _logger.Warn(ex, "Unable to set last write time"); } _mediaFileAttributeService.SetFilePermissions(destinationFilePath); @@ -206,7 +206,7 @@ namespace NzbDrone.Core.MediaFiles } catch (IOException ex) { - _logger.ErrorException("Unable to create directory: " + directoryName, ex); + _logger.Error(ex, "Unable to create directory: " + directoryName); } _mediaFileAttributeService.SetFolderPermissions(directoryName); diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs index 600841412..2f270c70a 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs @@ -114,7 +114,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport } catch (Exception e) { - _logger.WarnException("Couldn't import episode " + localEpisode, e); + _logger.Warn(e, "Couldn't import episode " + localEpisode); importResults.Add(new ImportResult(importDecision, "Failed to import episode")); } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index 6aeab444c..71f0ba938 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -111,7 +111,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport } catch (Exception e) { - _logger.ErrorException("Couldn't import file. " + file, e); + _logger.Error(e, "Couldn't import file. " + file); } return decision; @@ -140,7 +140,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport { //e.Data.Add("report", remoteEpisode.Report.ToJson()); //e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); - _logger.ErrorException("Couldn't evaluate decision on " + localEpisode.Path, e); + _logger.Error(e, "Couldn't evaluate decision on " + localEpisode.Path); return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs index c3fe8550e..158059e29 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs @@ -58,7 +58,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications } catch (Exception ex) { - _logger.ErrorException("Unable to check free disk space while importing: " + localEpisode.Path, ex); + _logger.Error(ex, "Unable to check free disk space while importing: " + localEpisode.Path); } return Decision.Accept(); diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs index c0a4eba37..a76c43abd 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs @@ -43,12 +43,12 @@ namespace NzbDrone.Core.MediaFiles if (ex is UnauthorizedAccessException || ex is InvalidOperationException || ex is FileNotFoundException) { _logger.Debug("Unable to apply folder permissions to: ", path); - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); } else { _logger.Warn("Unable to apply folder permissions to: ", path); - _logger.WarnException(ex.Message, ex); + _logger.Warn(ex, ex.Message); } } } @@ -91,8 +91,8 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { - _logger.WarnException("Unable to apply permissions to: " + path, ex); - _logger.DebugException(ex.Message, ex); + _logger.Warn(ex, "Unable to apply permissions to: " + path); + _logger.Debug(ex, ex.Message); } } } diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs index 53bf40dfd..b275fb03e 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs @@ -69,7 +69,7 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); - _logger.ErrorException(errorMessage, ex); + _logger.Error(ex, errorMessage); } } diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index bc34f10cb..204c06ae5 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -151,11 +151,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo } catch (DllNotFoundException ex) { - _logger.ErrorException("mediainfo is required but was not found", ex); + _logger.Error(ex, "mediainfo is required but was not found"); } catch (Exception ex) { - _logger.ErrorException("Unable to parse media info from file: " + filename, ex); + _logger.Error(ex, "Unable to parse media info from file: " + filename); } finally { diff --git a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index 95345f405..78ba4e8a9 100644 --- a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -118,7 +118,7 @@ namespace NzbDrone.Core.MediaFiles catch (IOException e) { var message = string.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination); - _logger.ErrorException(message, e); + _logger.Error(e, message); throw; } diff --git a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs index 95806f579..5bde0cab6 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs @@ -132,7 +132,7 @@ namespace NzbDrone.Core.MediaFiles } catch (Exception ex) { - _logger.ErrorException("Failed to rename file: " + episodeFilePath, ex); + _logger.Error(ex, "Failed to rename file: " + episodeFilePath); } } diff --git a/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs b/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs index 65bfc3a56..67b415c20 100644 --- a/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs @@ -135,7 +135,7 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { - _logger.WarnException("Unable to set date of file [" + filePath + "]", ex); + _logger.Warn(ex, "Unable to set date of file [" + filePath + "]"); } } } @@ -165,7 +165,7 @@ namespace NzbDrone.Core.MediaFiles catch (Exception ex) { ex.ExceptronIgnoreOnMono(); - _logger.WarnException("Unable to set date of file [" + filePath + "]", ex); + _logger.Warn(ex, "Unable to set date of file [" + filePath + "]"); } } diff --git a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs index bc328c7dc..ecb96d9be 100644 --- a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs +++ b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs @@ -42,18 +42,18 @@ namespace NzbDrone.Core.Messaging.Commands } catch (Exception ex) { - _logger.ErrorException("Error occurred while executing task " + command.Name, ex); + _logger.Error(ex, "Error occurred while executing task " + command.Name); } } } catch (ThreadAbortException ex) { - _logger.ErrorException("Thread aborted: " + ex.Message, ex); + _logger.Error(ex, "Thread aborted: " + ex.Message); Thread.ResetAbort(); } catch (Exception ex) { - _logger.ErrorException("Unknown error in thread: " + ex.Message, ex); + _logger.Error(ex, "Unknown error in thread: " + ex.Message); } } diff --git a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs index 2853dd57d..2ab68ceca 100644 --- a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs +++ b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs @@ -58,7 +58,7 @@ namespace NzbDrone.Core.Messaging.Events } catch (Exception e) { - _logger.ErrorException(string.Format("{0} failed while processing [{1}]", handler.GetType().Name, eventName), e); + _logger.Error(e, string.Format("{0} failed while processing [{1}]", handler.GetType().Name, eventName)); } } diff --git a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs index ceebd0813..92740a02e 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs @@ -335,7 +335,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc } catch (Exception ex) { - _logger.ErrorException("Unable to process episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath), ex); + _logger.Error(ex, "Unable to process episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath)); return new List(); } diff --git a/src/NzbDrone.Core/Metadata/MetadataService.cs b/src/NzbDrone.Core/Metadata/MetadataService.cs index 99d6e9733..281d474a4 100644 --- a/src/NzbDrone.Core/Metadata/MetadataService.cs +++ b/src/NzbDrone.Core/Metadata/MetadataService.cs @@ -380,7 +380,7 @@ namespace NzbDrone.Core.Metadata } catch (Exception e) { - _logger.ErrorException("Couldn't download image " + url + " for " + series, e); + _logger.Error(e, "Couldn't download image " + url + " for " + series); } } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 532d996ac..e8c570600 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -95,7 +95,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook } catch (Exception ex) { - _logger.WarnException(ex.Message, ex); + _logger.Warn(ex, ex.Message); throw new SkyHookException("Search for '{0}' failed. Invalid response received from SkyHook.", title); } } diff --git a/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs b/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs index f6b626025..43f7fbd3d 100644 --- a/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs +++ b/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs @@ -34,7 +34,7 @@ namespace NzbDrone.Core.Notifications.Boxcar } catch (BoxcarException ex) { - _logger.ErrorException("Unable to send message", ex); + _logger.Error(ex, "Unable to send message"); throw new BoxcarException("Unable to send Boxcar notifications"); } } @@ -53,16 +53,16 @@ namespace NzbDrone.Core.Notifications.Boxcar { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.ErrorException("Access Token is invalid: " + ex.Message, ex); + _logger.Error(ex, "Access Token is invalid: " + ex.Message); return new ValidationFailure("Token", "Access Token is invalid"); } - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Token", "Unable to send test message"); } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("", "Unable to send test message"); } } @@ -84,7 +84,7 @@ namespace NzbDrone.Core.Notifications.Boxcar { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.ErrorException("Access Token is invalid: " + ex.Message, ex); + _logger.Error(ex, "Access Token is invalid: " + ex.Message); throw; } diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index d4cbd0e42..bd7a387b0 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Notifications.Email catch(Exception ex) { _logger.Error("Error sending email. Subject: {0}", email.Subject); - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); } } @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Notifications.Email catch (Exception ex) { - _logger.ErrorException("There was an error sending an email.", ex); + _logger.Error(ex, "There was an error sending an email."); throw; } } @@ -76,7 +76,7 @@ namespace NzbDrone.Core.Notifications.Email } catch (Exception ex) { - _logger.ErrorException("Unable to send test email: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test email: " + ex.Message); return new ValidationFailure("Server", "Unable to send test email"); } diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs index 3839e1592..73f6bc3b5 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs @@ -152,7 +152,7 @@ namespace NzbDrone.Core.Notifications.Growl } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs index 64867d926..748d2a67f 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs @@ -52,7 +52,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Host", "Unable to send test message: " + ex.Message); } diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index 007b65ef3..6ae201fb2 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -107,7 +107,7 @@ namespace NzbDrone.Core.Notifications catch (Exception ex) { - _logger.ErrorException("Unable to send OnGrab notification to: " + notification.Definition.Name, ex); + _logger.Error(ex, "Unable to send OnGrab notification to: " + notification.Definition.Name); } } } @@ -136,7 +136,7 @@ namespace NzbDrone.Core.Notifications catch (Exception ex) { - _logger.WarnException("Unable to send OnDownload notification to: " + notification.Definition.Name, ex); + _logger.Warn(ex, "Unable to send OnDownload notification to: " + notification.Definition.Name); } } } @@ -155,7 +155,7 @@ namespace NzbDrone.Core.Notifications catch (Exception ex) { - _logger.WarnException("Unable to send OnRename notification to: " + notification.Definition.Name, ex); + _logger.Warn(ex, "Unable to send OnRename notification to: " + notification.Definition.Name); } } } diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs index 44dd8b3e6..ce4d97790 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs @@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs index e73b30568..a7ce8d02d 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.Notifications.Plex } catch(Exception ex) { - _logger.WarnException("Failed to send notification to Plex Client: " + settings.Host, ex); + _logger.Warn(ex, "Failed to send notification to Plex Client: " + settings.Host); } } @@ -67,7 +67,7 @@ namespace NzbDrone.Core.Notifications.Plex } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs index 43819b5ed..42b5098d8 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs @@ -81,7 +81,7 @@ namespace NzbDrone.Core.Notifications.Plex catch (SocketException ex) { var logMessage = string.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port); - _logger.DebugException(logMessage, ex); + _logger.Debug(ex, logMessage); } } } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs index 728e668db..8397013db 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs @@ -52,7 +52,7 @@ namespace NzbDrone.Core.Notifications.Plex catch(Exception ex) { - _logger.WarnException("Failed to Update Plex host: " + settings.Host, ex); + _logger.Warn(ex, "Failed to Update Plex host: " + settings.Host); throw; } } @@ -86,7 +86,7 @@ namespace NzbDrone.Core.Notifications.Plex } catch (Exception ex) { - _logger.WarnException("Unable to check if partial updates are allowed", ex); + _logger.Warn(ex, "Unable to check if partial updates are allowed"); } return false; @@ -158,12 +158,12 @@ namespace NzbDrone.Core.Notifications.Plex } catch(PlexAuthenticationException ex) { - _logger.ErrorException("Unable to connect to Plex Server: " + ex.Message, ex); + _logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message); return new ValidationFailure("Username", "Incorrect username or password"); } catch (Exception ex) { - _logger.ErrorException("Unable to connect to Plex Server: " + ex.Message, ex); + _logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message); return new ValidationFailure("Host", "Unable to connect to Plex Server"); } diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs index fbbbd9c84..bf56dbad3 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Core.Notifications.Prowl catch (Exception ex) { - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); _logger.Warn("Invalid API Key: {0}", apiKey); } } @@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.Prowl catch (Exception ex) { - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); _logger.Warn("Invalid API Key: {0}", apiKey); throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid"); } @@ -94,7 +94,7 @@ namespace NzbDrone.Core.Notifications.Prowl } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index d9dfca8fb..809f543b5 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Notifications.PushBullet } catch (PushBulletException ex) { - _logger.ErrorException("Unable to send test message to: " + channelTag, ex); + _logger.Error(ex, "Unable to send test message to: " + channelTag); error = true; } } @@ -60,7 +60,7 @@ namespace NzbDrone.Core.Notifications.PushBullet } catch (PushBulletException ex) { - _logger.ErrorException("Unable to send test message to: " + deviceId, ex); + _logger.Error(ex, "Unable to send test message to: " + deviceId); error = true; } } @@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.PushBullet } catch (PushBulletException ex) { - _logger.ErrorException("Unable to send test message to all devices", ex); + _logger.Error(ex, "Unable to send test message to all devices"); error = true; } } @@ -100,16 +100,16 @@ namespace NzbDrone.Core.Notifications.PushBullet { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.ErrorException("API Key is invalid: " + ex.Message, ex); + _logger.Error(ex, "API Key is invalid: " + ex.Message); return new ValidationFailure("ApiKey", "API Key is invalid"); } - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("ApiKey", "Unable to send test message"); } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("", "Unable to send test message"); } @@ -164,7 +164,7 @@ namespace NzbDrone.Core.Notifications.PushBullet { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.ErrorException("API Key is invalid: " + ex.Message, ex); + _logger.Error(ex, "API Key is invalid: " + ex.Message); throw; } diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs index 7919cf1ac..97b3215d8 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs @@ -73,30 +73,30 @@ namespace NzbDrone.Core.Notifications.Pushalot { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.ErrorException("Authentication Token is invalid: " + ex.Message, ex); + _logger.Error(ex, "Authentication Token is invalid: " + ex.Message); return new ValidationFailure("AuthToken", "Authentication Token is invalid"); } if (ex.Response.StatusCode == HttpStatusCode.NotAcceptable) { - _logger.ErrorException("Message limit reached: " + ex.Message, ex); + _logger.Error(ex, "Message limit reached: " + ex.Message); return new ValidationFailure("AuthToken", "Message limit reached"); } if (ex.Response.StatusCode == HttpStatusCode.Gone) { - _logger.ErrorException("Authorization Token is no longer valid: " + ex.Message, ex); + _logger.Error(ex, "Authorization Token is no longer valid: " + ex.Message); return new ValidationFailure("AuthToken", "Authorization Token is no longer valid, please use a new one."); } var response = Json.Deserialize(ex.Response.Content); - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("AuthToken", response.Description); } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs index e61b64fcb..940ab9ffd 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs @@ -59,7 +59,7 @@ namespace NzbDrone.Core.Notifications.Pushover } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs index 18fa33433..ac0f70bd2 100644 --- a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Notifications.Synology } catch (Exception ex) { - _logger.WarnException("synoindex not available", ex); + _logger.Warn(ex, "synoindex not available"); return false; } } diff --git a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs index 12a4cf28d..d60f6c435 100644 --- a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs +++ b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs @@ -131,7 +131,7 @@ namespace NzbDrone.Core.Notifications.Twitter } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Host", "Unable to send test message"); } return null; diff --git a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs index e84566635..76f2bc91f 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs @@ -74,7 +74,7 @@ namespace NzbDrone.Core.Notifications.Xbmc catch (Exception ex) { - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); } return new List(); @@ -163,7 +163,7 @@ namespace NzbDrone.Core.Notifications.Xbmc catch (Exception ex) { - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs index 3651b927a..1a0674908 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs @@ -105,7 +105,7 @@ namespace NzbDrone.Core.Notifications.Xbmc catch (Exception ex) { - _logger.DebugException(ex.Message, ex); + _logger.Debug(ex, ex.Message); } } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs index 9d1b0157d..2712f2faa 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs @@ -74,7 +74,7 @@ namespace NzbDrone.Core.Notifications.Xbmc catch (SocketException ex) { var logMessage = string.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); - _logger.DebugException(logMessage, ex); + _logger.Debug(ex, logMessage); } } @@ -95,7 +95,7 @@ namespace NzbDrone.Core.Notifications.Xbmc catch (SocketException ex) { var logMessage = string.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); - _logger.DebugException(logMessage, ex); + _logger.Debug(ex, logMessage); } } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs index 20a9d7f26..3f4bcced2 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs @@ -116,7 +116,7 @@ namespace NzbDrone.Core.Notifications.Xbmc } catch (Exception ex) { - _logger.ErrorException("Unable to send test message: " + ex.Message, ex); + _logger.Error(ex, "Unable to send test message: " + ex.Message); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 397c8a21f..11879b123 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -80,6 +80,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + ..\packages\OAuth.1.0.3\lib\net40\OAuth.dll @@ -101,9 +105,6 @@ - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll @@ -1118,4 +1119,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index a0eef5ad0..ec183f0ea 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -358,7 +358,7 @@ namespace NzbDrone.Core.Parser } catch (InvalidDateException ex) { - Logger.DebugException(ex.Message, ex); + Logger.Debug(ex, ex.Message); break; } } @@ -367,7 +367,7 @@ namespace NzbDrone.Core.Parser catch (Exception e) { if (!title.ToLower().Contains("password") && !title.ToLower().Contains("yenc")) - Logger.ErrorException("An error has occurred while trying to parse " + title, e); + Logger.Error(e, "An error has occurred while trying to parse " + title); } Logger.Debug("Unable to parse {0}", title); diff --git a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs index 3a0bb2a4e..353914964 100644 --- a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs +++ b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Rest if (response.ResponseUri == null) { - Logger.ErrorException("Error communicating with server", response.ErrorException); + Logger.Error(response.ErrorException, "Error communicating with server"); throw response.ErrorException; } diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index da1bb1f3b..f1a1145e9 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -78,7 +78,7 @@ namespace NzbDrone.Core.RootFolders //We don't want an exception to prevent the root folders from loading in the UI, so they can still be deleted catch (Exception ex) { - _logger.ErrorException("Unable to get free space and unmapped folders for root folder: " + folder.Path, ex); + _logger.Error(ex, "Unable to get free space and unmapped folders for root folder: " + folder.Path); folder.FreeSpace = 0; folder.UnmappedFolders = new List(); } diff --git a/src/NzbDrone.Core/Tv/MoveSeriesService.cs b/src/NzbDrone.Core/Tv/MoveSeriesService.cs index be5b66403..9f027bf25 100644 --- a/src/NzbDrone.Core/Tv/MoveSeriesService.cs +++ b/src/NzbDrone.Core/Tv/MoveSeriesService.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Tv { var errorMessage = string.Format("Unable to move series from '{0}' to '{1}'", source, destination); - _logger.ErrorException(errorMessage, ex); + _logger.Error(ex, errorMessage); throw; } diff --git a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs index 5882810f5..7d1a7d993 100644 --- a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs +++ b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs @@ -77,7 +77,7 @@ namespace NzbDrone.Core.Tv } catch (Exception e) { - _logger.FatalException(string.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode), e); + _logger.Fatal(e, string.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode)); failCount++; } } diff --git a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs index c59cee64f..8f46dbae1 100644 --- a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs +++ b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs @@ -102,7 +102,7 @@ namespace NzbDrone.Core.Tv } catch (Exception e) { - _logger.WarnException("Couldn't update series path for " + series.Path, e); + _logger.Warn(e, "Couldn't update series path for " + series.Path); } series.Seasons = UpdateSeasons(series, seriesInfo); @@ -165,7 +165,7 @@ namespace NzbDrone.Core.Tv } catch (Exception e) { - _logger.ErrorException("Couldn't refresh info for {0}".Inject(series), e); + _logger.Error(e, "Couldn't refresh info for {0}".Inject(series)); } } @@ -178,7 +178,7 @@ namespace NzbDrone.Core.Tv } catch (Exception e) { - _logger.ErrorException("Couldn't rescan series {0}".Inject(series), e); + _logger.Error(e, "Couldn't rescan series {0}".Inject(series)); } } } diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index 2e32e4bc3..e5ef7fa30 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -148,7 +148,7 @@ namespace NzbDrone.Core.Update } catch (Exception e) { - _logger.ErrorException(string.Format("Couldn't change the branch from [{0}] to [{1}].", currentBranch, package.Branch), e); + _logger.Error(e, string.Format("Couldn't change the branch from [{0}] to [{1}].", currentBranch, package.Branch)); } } } @@ -215,17 +215,17 @@ namespace NzbDrone.Core.Update } catch (UpdateFolderNotWritableException ex) { - _logger.ErrorException("Update process failed", ex); + _logger.Error(ex, "Update process failed"); throw new CommandFailedException("Startup folder not writable by user '{0}'", ex, Environment.UserName); } catch (UpdateVerificationFailedException ex) { - _logger.ErrorException("Update process failed", ex); + _logger.Error(ex, "Update process failed"); throw new CommandFailedException("Downloaded update package is corrupt", ex); } catch (UpdateFailedException ex) { - _logger.ErrorException("Update process failed", ex); + _logger.Error(ex, "Update process failed"); throw new CommandFailedException(ex); } } diff --git a/src/NzbDrone.Core/packages.config b/src/NzbDrone.Core/packages.config index 3a9decb52..f50c7706b 100644 --- a/src/NzbDrone.Core/packages.config +++ b/src/NzbDrone.Core/packages.config @@ -5,7 +5,7 @@ - + diff --git a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs index 8b398deec..794e9edff 100644 --- a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs +++ b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Host.AccessControl } catch (Exception ex) { - _logger.WarnException("Failed to check for open port in firewall", ex); + _logger.Warn(ex, "Failed to check for open port in firewall"); } return false; } @@ -81,7 +81,7 @@ namespace NzbDrone.Host.AccessControl } catch (Exception ex) { - _logger.WarnException("Failed to open port in firewall for NzbDrone " + portNumber, ex); + _logger.Warn(ex, "Failed to open port in firewall for NzbDrone " + portNumber); } } @@ -97,7 +97,7 @@ namespace NzbDrone.Host.AccessControl } catch (Exception ex) { - _logger.WarnException("Failed to check if the firewall is enabled", ex); + _logger.Warn(ex, "Failed to check if the firewall is enabled"); return false; } } diff --git a/src/NzbDrone.Host/AccessControl/NetshProvider.cs b/src/NzbDrone.Host/AccessControl/NetshProvider.cs index dc9e8b754..88bcd880c 100644 --- a/src/NzbDrone.Host/AccessControl/NetshProvider.cs +++ b/src/NzbDrone.Host/AccessControl/NetshProvider.cs @@ -30,7 +30,7 @@ namespace NzbDrone.Host.AccessControl } catch (Exception ex) { - _logger.WarnException("Error executing netsh with arguments: " + arguments, ex); + _logger.Warn(ex, "Error executing netsh with arguments: " + arguments); } return null; diff --git a/src/NzbDrone.Host/BrowserService.cs b/src/NzbDrone.Host/BrowserService.cs index dc21c011d..1867421cf 100644 --- a/src/NzbDrone.Host/BrowserService.cs +++ b/src/NzbDrone.Host/BrowserService.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Host } catch (Exception e) { - _logger.ErrorException("Couldn't open default browser to " + url, e); + _logger.Error(e, "Couldn't open default browser to " + url); } } } diff --git a/src/NzbDrone.Host/NLog.xsd b/src/NzbDrone.Host/NLog.xsd deleted file mode 100644 index 49dd62049..000000000 --- a/src/NzbDrone.Host/NLog.xsd +++ /dev/null @@ -1,2638 +0,0 @@ - - - - - - - - - - - - - - Watch config file for changes and reload automatically. - - - - - Print internal NLog messages to the console. Default value is: false - - - - - Print internal NLog messages to the console error output. Default value is: false - - - - - Write internal NLog messages to the specified file. - - - - - Log level threshold for internal log messages. Default value is: Info. - - - - - Global log level threshold for application log messages. Messages below this level won't be logged.. - - - - - Pass NLog internal exceptions to the application. Default value is: false. - - - - - - - - - - - - - - Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). - - - - - - - - - - - - - - - - - Prefix for targets/layout renderers/filters/conditions loaded from this assembly. - - - - - Load NLog extensions from the specified file (*.dll) - - - - - Load NLog extensions from the specified assembly. Assembly name should be fully qualified. - - - - - - - - - - Name of the logger. May include '*' character which acts like a wildcard. Allowed forms are: *, Name, *Name, Name* and *Name* - - - - - Comma separated list of levels that this rule matches. - - - - - Minimum level that this rule matches. - - - - - Maximum level that this rule matches. - - - - - Level that this rule matches. - - - - - Comma separated list of target names. - - - - - Ignore further rules if this one matches. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the file to be included. The name is relative to the name of the current config file. - - - - - Ignore any errors in the include file. - - - - - - - Variable name. - - - - - Variable value. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether buffer should grow as needed. - - - - - Number of log events to be buffered. - - - - - Maximum number of log events that the buffer can keep. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to add <!-- --> comments around all written texts. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Limit on the number of requests in the lazy writer thread request queue. - - - - - Time in milliseconds to sleep between batches. - - - - - Number of log events that should be processed in a batch by the lazy writer thread. - - - - - Action to be taken when the lazy writer thread request queue count exceeds the set limit. - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to use sliding timeout. - - - - - Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. - - - - - Number of log events to be buffered. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Indicates whether to keep connection open whenever possible. - - - - - Maximum queue size. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include stack contents. - - - - - NDC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - - - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Viewer parameter name. - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - Indicates whether to use default row highlighting rules. - - - - - Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Condition that must be met in order to set the specified foreground and background color. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing texts. - - - - - Regular expression to be matched. You must specify either text or regex. - - - - - Text to be matched. You must specify either text or regex. - - - - - Indicates whether to match whole words only. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - Indicates whether to send the log messages to the standard error instead of the standard output. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. - - - - - Name of the database provider. - - - - - Indicates whether to use database transactions. Some data providers require this. - - - - - Indicates whether to keep the database connection open between the log events. - - - - - Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. - - - - - Name of the connection string (as specified in <connectionStrings> configuration section. - - - - - Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. - - - - - Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. - - - - - Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. - - - - - Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. - - - - - Text of the SQL command to be run on each log level. - - - - - - - - - - - - - - - - - - - - - - - Type of the command. - - - - - Connection string to run the command against. If not provided, connection string from the target is used. - - - - - Indicates whether to ignore failures. - - - - - Command text. - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Database parameter name. - - - - - Database parameter precision. - - - - - Database parameter scale. - - - - - Database parameter size. - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Name of the machine on which Event Log service is running. - - - - - Value to be used as the event Source. - - - - - Name of the Event Log to write to. This can be System, Application or any user-defined name. - - - - - Layout that renders event Category. - - - - - Layout that renders event ID. - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to return to the first target after any successful write. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - File encoding. - - - - - Line ending mode. - - - - - Footer. - - - - - Text to be rendered. - - - - - Header. - - - - - Indicates whether to automatically archive log files every time the specified time passes. - - - - - Size in bytes above which log files will be automatically archived. - - - - - Name of the file to be used for an archive. - - - - - Maximum number of archive files that should be kept. - - - - - Way file archives are numbered. - - - - - Gets ors set a value indicating whether a managed file stream is forced, instead of used the native implementation. - - - - - File attributes (Windows only). - - - - - Indicates whether to delete old log file on startup. - - - - - Indicates whether to enable log file(s) to be deleted. - - - - - Indicates whether to create directories if they don't exist. - - - - - Indicates whether to replace file contents on each write instead of appending log message at the end. - - - - - Name of the file to write to. - - - - - Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity. - - - - - Log file buffer size in bytes. - - - - - Number of times the write is appended on the file before NLog discards the log message. - - - - - Delay in milliseconds to wait before attempting to write to the file again. - - - - - Indicates whether to automatically flush the file buffers after each log message. - - - - - Indicates whether concurrent writes to the log file by multiple processes on the same host. - - - - - Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). - - - - - Indicates whether concurrent writes to the log file by multiple processes on different network hosts. - - - - - Indicates whether to keep log file open instead of opening and closing it on each logging event. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Condition expression. Log events who meet this condition will be forwarded to the wrapped target. - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Name of the Form on which the control is located. - - - - - Name of control to which NLog will log write log text. - - - - - Indicates whether log text should be appended to the text of the control instead of overwriting it. - - - - - Whether new log entry are added to the start or the end of the control - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - User account password. - - - - - Indicates whether to revert to the credentials of the process instead of impersonating another user. - - - - - Username to change context to. - - - - - Logon Type. - - - - - Windows domain name to change context to. - - - - - Required impersonation level. - - - - - Type of the logon provider. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Name of the endpoint configuration in WCF configuration file. - - - - - Endpoint address. - - - - - Indicates whether to use binary message encoding. - - - - - Client ID. - - - - - Indicates whether to include per-event properties in the payload sent to the server. - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Name of the parameter. - - - - - Type of the parameter. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to send message as HTML instead of plain text. - - - - - Encoding to be used for sending e-mail. - - - - - Indicates whether to add new lines between log entries. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - Mail subject. - - - - - Mail message body (repeated for each log message send in one mail). - - - - - Sender's email address (e.g. joe@domain.com). - - - - - Indicates whether NewLine characters in the body should be replaced with tags. - - - - - Priority used for sending mails. - - - - - Indicates whether the default Settings from System.Net.MailSettings should be used. - - - - - SMTP Server to be used for sending. - - - - - Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Port number that SMTP Server is listening on. - - - - - SMTP Authentication mode. - - - - - Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Message box title. - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to use the XML format when serializing message. This will also disable creating queues. - - - - - Indicates whether to check if a queue exists before writing to it. - - - - - Layout used to format log messages. - - - - - Encoding to be used when writing text to the queue. - - - - - Name of the queue to write to. - - - - - Indicates whether to use recoverable messages (with guaranteed delivery). - - - - - Indicates whether to create the queue if it doesn't exists. - - - - - Label to associate with each message. - - - - - - - - - - - - - - - - - Name of the target. - - - - - Method name. The method must be public and static. - - - - - Class name. - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Layout used to format log messages. - - - - - Encoding to be used. - - - - - Indicates whether to keep connection open whenever possible. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Network address. - - - - - Maximum queue size. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Indicates whether to keep connection open whenever possible. - - - - - Maximum queue size. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include stack contents. - - - - - NDC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to perform layout calculation. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Name of the performance counter. - - - - - Performance counter type. - - - - - Performance counter instance name. - - - - - Indicates whether performance counter should be automatically created. - - - - - Name of the performance counter category. - - - - - Counter help text. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Default filter to be applied when no specific rule matches. - - - - - - - - - - - - - Condition to be tested. - - - - - Resulting filter to be applied when the condition matches. - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - Name of the target. - - - - - Number of times to repeat each log message. - - - - - - - - - - - - - - - - Name of the target. - - - - - Time to wait between retries in milliseconds. - - - - - Number of retries that should be attempted on the wrapped target in case of a failure. - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Indicates whether the created form will be initially minimized. - - - - - Maximum number of lines the rich text box will store (or 0 to disable this feature). - - - - - Initial width of the form with rich text box. - - - - - Indicates whether the created window will be a tool window. - - - - - Name of RichTextBox to which Nlog will write. - - - - - Indicates whether scroll bar will be moved automatically to show most recent log entries. - - - - - Initial height of the form with rich text box. - - - - - Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one. - - - - - Indicates whether to use default coloring rules. - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing texts. - - - - - Regular expression to be matched. You must specify either text or regex. - - - - - Text to be matched. You must specify either text or regex. - - - - - Indicates whether to match whole words only. - - - - - Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed. - - - - - Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed. - - - - - Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing. - - - - - - - - - - - - - Condition that must be met in order to set the specified font color. - - - - - Background color. - - - - - Font color. - - - - - Font style of matched text. - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Web service URL. - - - - - Web service namespace. - - - - - Protocol to be used when calling web service. - - - - - Web service method name. - - - - - Encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Body layout (can be repeated multiple times). - - - - - Header layout. - - - - - Footer layout. - - - - - Quote Character. - - - - - Quoting mode. - - - - - Indicates whether CVS should include header. - - - - - Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). - - - - - Column delimiter. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Layout of the column. - - - - - Name of the column. - - - - - - - - - - - - - - Body layout (can be repeated multiple times). - - - - - Header layout. - - - - - Footer layout. - - - - - - - - - - - - - - - - - - - - - Layout text. - - - - - - - - - - - - - - - Condition expression. - - - - - Action to be taken when filter matches. - - - - - - - - - - - - - - - - - - - - - - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - - - - - - - - - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - - \ No newline at end of file diff --git a/src/NzbDrone.Host/NzbDrone.Host.csproj b/src/NzbDrone.Host/NzbDrone.Host.csproj index 55de3faee..6e43c9ac8 100644 --- a/src/NzbDrone.Host/NzbDrone.Host.csproj +++ b/src/NzbDrone.Host/NzbDrone.Host.csproj @@ -81,6 +81,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + @@ -88,9 +92,6 @@ ..\Libraries\Interop.NetFwTypeLib.dll True - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -131,9 +132,6 @@ - - Designer - @@ -208,4 +206,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Host/SingleInstancePolicy.cs b/src/NzbDrone.Host/SingleInstancePolicy.cs index 2f9f84ed2..75b8bb13e 100644 --- a/src/NzbDrone.Host/SingleInstancePolicy.cs +++ b/src/NzbDrone.Host/SingleInstancePolicy.cs @@ -71,7 +71,7 @@ namespace NzbDrone.Host } catch (Exception ex) { - _logger.WarnException("Failed to check for multiple instances of Sonarr.", ex); + _logger.Warn(ex, "Failed to check for multiple instances of Sonarr."); return new List(); } } diff --git a/src/NzbDrone.Host/packages.config b/src/NzbDrone.Host/packages.config index 987bfe54a..0b986f2f7 100644 --- a/src/NzbDrone.Host/packages.config +++ b/src/NzbDrone.Host/packages.config @@ -6,7 +6,6 @@ - - + - + \ No newline at end of file diff --git a/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj b/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj index 458af3eeb..d0d89974b 100644 --- a/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj +++ b/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj @@ -76,6 +76,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -94,9 +98,6 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -183,4 +184,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Integration.Test/packages.config b/src/NzbDrone.Integration.Test/packages.config index 7bae9b11a..db12fdc32 100644 --- a/src/NzbDrone.Integration.Test/packages.config +++ b/src/NzbDrone.Integration.Test/packages.config @@ -10,7 +10,7 @@ - + diff --git a/src/NzbDrone.Mono/DiskProvider.cs b/src/NzbDrone.Mono/DiskProvider.cs index d480e9066..86fc3b1dd 100644 --- a/src/NzbDrone.Mono/DiskProvider.cs +++ b/src/NzbDrone.Mono/DiskProvider.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Mono } catch (InvalidOperationException ex) { - Logger.ErrorException("Couldn't get free space for " + path, ex); + Logger.Error(ex, "Couldn't get free space for " + path); } return null; @@ -149,7 +149,7 @@ namespace NzbDrone.Mono } catch (InvalidOperationException e) { - Logger.ErrorException("Couldn't get total space for " + path, e); + Logger.Error(e, "Couldn't get total space for " + path); } return null; @@ -164,7 +164,7 @@ namespace NzbDrone.Mono } catch (Exception ex) { - Logger.DebugException(string.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); + Logger.Debug(ex, string.Format("Hardlink '{0}' to '{1}' failed.", source, destination)); return false; } } diff --git a/src/NzbDrone.Mono/MonoRuntimeProvider.cs b/src/NzbDrone.Mono/MonoRuntimeProvider.cs index f985b681c..95f4b6f4a 100644 --- a/src/NzbDrone.Mono/MonoRuntimeProvider.cs +++ b/src/NzbDrone.Mono/MonoRuntimeProvider.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Mono } catch (Exception ex) { - _logger.ErrorException("Unable to get mono version: " + ex.Message, ex); + _logger.Error(ex, "Unable to get mono version: " + ex.Message); } return string.Empty; diff --git a/src/NzbDrone.Mono/NzbDrone.Mono.csproj b/src/NzbDrone.Mono/NzbDrone.Mono.csproj index 91c065b27..72fbebfce 100644 --- a/src/NzbDrone.Mono/NzbDrone.Mono.csproj +++ b/src/NzbDrone.Mono/NzbDrone.Mono.csproj @@ -51,6 +51,10 @@ MinimumRecommendedRules.ruleset + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + @@ -62,10 +66,6 @@ False ..\Libraries\Mono.Posix.dll - - False - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - diff --git a/src/NzbDrone.Mono/ProcMountProvider.cs b/src/NzbDrone.Mono/ProcMountProvider.cs index f2e0953be..08c2db7dd 100644 --- a/src/NzbDrone.Mono/ProcMountProvider.cs +++ b/src/NzbDrone.Mono/ProcMountProvider.cs @@ -40,7 +40,7 @@ namespace NzbDrone.Mono } catch (Exception ex) { - _logger.DebugException("Failed to retrieve mounts from /proc/mounts", ex); + _logger.Debug(ex, "Failed to retrieve mounts from /proc/mounts"); } return new List(); @@ -67,7 +67,7 @@ namespace NzbDrone.Mono } catch (Exception ex) { - _logger.DebugException("Failed to get filesystem types from /proc/filesystems, using default set.", ex); + _logger.Debug(ex, "Failed to get filesystem types from /proc/filesystems, using default set."); } if (result.Empty()) diff --git a/src/NzbDrone.Mono/SymbolicLinkResolver.cs b/src/NzbDrone.Mono/SymbolicLinkResolver.cs index dad2f05b5..f2206f28d 100644 --- a/src/NzbDrone.Mono/SymbolicLinkResolver.cs +++ b/src/NzbDrone.Mono/SymbolicLinkResolver.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Mono } catch (Exception ex) { - _logger.DebugException(string.Format("Failed to check for symlinks in the path {0}", path), ex); + _logger.Debug(ex, string.Format("Failed to check for symlinks in the path {0}", path)); return path; } } diff --git a/src/NzbDrone.Mono/packages.config b/src/NzbDrone.Mono/packages.config index d5e3be0f3..6645420b9 100644 --- a/src/NzbDrone.Mono/packages.config +++ b/src/NzbDrone.Mono/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj b/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj index 03d6b33af..ac4ca64da 100644 --- a/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj +++ b/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj @@ -49,6 +49,10 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -76,9 +80,6 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - diff --git a/src/NzbDrone.Test.Common/packages.config b/src/NzbDrone.Test.Common/packages.config index eb0caa7d4..367271644 100644 --- a/src/NzbDrone.Test.Common/packages.config +++ b/src/NzbDrone.Test.Common/packages.config @@ -4,7 +4,7 @@ - + diff --git a/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj b/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj index 001fbee85..09071d29b 100644 --- a/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj +++ b/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj @@ -45,6 +45,10 @@ ..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll True + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + False ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -62,9 +66,6 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - @@ -104,4 +105,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Update.Test/packages.config b/src/NzbDrone.Update.Test/packages.config index fbfd4be97..d2ca2334f 100644 --- a/src/NzbDrone.Update.Test/packages.config +++ b/src/NzbDrone.Update.Test/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.Update/NLog.xsd b/src/NzbDrone.Update/NLog.xsd deleted file mode 100644 index 49dd62049..000000000 --- a/src/NzbDrone.Update/NLog.xsd +++ /dev/null @@ -1,2638 +0,0 @@ - - - - - - - - - - - - - - Watch config file for changes and reload automatically. - - - - - Print internal NLog messages to the console. Default value is: false - - - - - Print internal NLog messages to the console error output. Default value is: false - - - - - Write internal NLog messages to the specified file. - - - - - Log level threshold for internal log messages. Default value is: Info. - - - - - Global log level threshold for application log messages. Messages below this level won't be logged.. - - - - - Pass NLog internal exceptions to the application. Default value is: false. - - - - - - - - - - - - - - Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). - - - - - - - - - - - - - - - - - Prefix for targets/layout renderers/filters/conditions loaded from this assembly. - - - - - Load NLog extensions from the specified file (*.dll) - - - - - Load NLog extensions from the specified assembly. Assembly name should be fully qualified. - - - - - - - - - - Name of the logger. May include '*' character which acts like a wildcard. Allowed forms are: *, Name, *Name, Name* and *Name* - - - - - Comma separated list of levels that this rule matches. - - - - - Minimum level that this rule matches. - - - - - Maximum level that this rule matches. - - - - - Level that this rule matches. - - - - - Comma separated list of target names. - - - - - Ignore further rules if this one matches. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the file to be included. The name is relative to the name of the current config file. - - - - - Ignore any errors in the include file. - - - - - - - Variable name. - - - - - Variable value. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether buffer should grow as needed. - - - - - Number of log events to be buffered. - - - - - Maximum number of log events that the buffer can keep. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to add <!-- --> comments around all written texts. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Limit on the number of requests in the lazy writer thread request queue. - - - - - Time in milliseconds to sleep between batches. - - - - - Number of log events that should be processed in a batch by the lazy writer thread. - - - - - Action to be taken when the lazy writer thread request queue count exceeds the set limit. - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to use sliding timeout. - - - - - Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. - - - - - Number of log events to be buffered. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Indicates whether to keep connection open whenever possible. - - - - - Maximum queue size. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include stack contents. - - - - - NDC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - - - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Viewer parameter name. - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - Indicates whether to use default row highlighting rules. - - - - - Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Condition that must be met in order to set the specified foreground and background color. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing texts. - - - - - Regular expression to be matched. You must specify either text or regex. - - - - - Text to be matched. You must specify either text or regex. - - - - - Indicates whether to match whole words only. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - Indicates whether to send the log messages to the standard error instead of the standard output. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. - - - - - Name of the database provider. - - - - - Indicates whether to use database transactions. Some data providers require this. - - - - - Indicates whether to keep the database connection open between the log events. - - - - - Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. - - - - - Name of the connection string (as specified in <connectionStrings> configuration section. - - - - - Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. - - - - - Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. - - - - - Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. - - - - - Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. - - - - - Text of the SQL command to be run on each log level. - - - - - - - - - - - - - - - - - - - - - - - Type of the command. - - - - - Connection string to run the command against. If not provided, connection string from the target is used. - - - - - Indicates whether to ignore failures. - - - - - Command text. - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Database parameter name. - - - - - Database parameter precision. - - - - - Database parameter scale. - - - - - Database parameter size. - - - - - - - - - - - - - - - Name of the target. - - - - - Footer. - - - - - Header. - - - - - Text to be rendered. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Name of the machine on which Event Log service is running. - - - - - Value to be used as the event Source. - - - - - Name of the Event Log to write to. This can be System, Application or any user-defined name. - - - - - Layout that renders event Category. - - - - - Layout that renders event ID. - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to return to the first target after any successful write. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - File encoding. - - - - - Line ending mode. - - - - - Footer. - - - - - Text to be rendered. - - - - - Header. - - - - - Indicates whether to automatically archive log files every time the specified time passes. - - - - - Size in bytes above which log files will be automatically archived. - - - - - Name of the file to be used for an archive. - - - - - Maximum number of archive files that should be kept. - - - - - Way file archives are numbered. - - - - - Gets ors set a value indicating whether a managed file stream is forced, instead of used the native implementation. - - - - - File attributes (Windows only). - - - - - Indicates whether to delete old log file on startup. - - - - - Indicates whether to enable log file(s) to be deleted. - - - - - Indicates whether to create directories if they don't exist. - - - - - Indicates whether to replace file contents on each write instead of appending log message at the end. - - - - - Name of the file to write to. - - - - - Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity. - - - - - Log file buffer size in bytes. - - - - - Number of times the write is appended on the file before NLog discards the log message. - - - - - Delay in milliseconds to wait before attempting to write to the file again. - - - - - Indicates whether to automatically flush the file buffers after each log message. - - - - - Indicates whether concurrent writes to the log file by multiple processes on the same host. - - - - - Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). - - - - - Indicates whether concurrent writes to the log file by multiple processes on different network hosts. - - - - - Indicates whether to keep log file open instead of opening and closing it on each logging event. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Condition expression. Log events who meet this condition will be forwarded to the wrapped target. - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Name of the Form on which the control is located. - - - - - Name of control to which NLog will log write log text. - - - - - Indicates whether log text should be appended to the text of the control instead of overwriting it. - - - - - Whether new log entry are added to the start or the end of the control - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - User account password. - - - - - Indicates whether to revert to the credentials of the process instead of impersonating another user. - - - - - Username to change context to. - - - - - Logon Type. - - - - - Windows domain name to change context to. - - - - - Required impersonation level. - - - - - Type of the logon provider. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Name of the endpoint configuration in WCF configuration file. - - - - - Endpoint address. - - - - - Indicates whether to use binary message encoding. - - - - - Client ID. - - - - - Indicates whether to include per-event properties in the payload sent to the server. - - - - - - - - - - - - - - Layout that should be use to calcuate the value for the parameter. - - - - - Name of the parameter. - - - - - Type of the parameter. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to send message as HTML instead of plain text. - - - - - Encoding to be used for sending e-mail. - - - - - Indicates whether to add new lines between log entries. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - Mail subject. - - - - - Mail message body (repeated for each log message send in one mail). - - - - - Sender's email address (e.g. joe@domain.com). - - - - - Indicates whether NewLine characters in the body should be replaced with tags. - - - - - Priority used for sending mails. - - - - - Indicates whether the default Settings from System.Net.MailSettings should be used. - - - - - SMTP Server to be used for sending. - - - - - Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Port number that SMTP Server is listening on. - - - - - SMTP Authentication mode. - - - - - Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Message box title. - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to use the XML format when serializing message. This will also disable creating queues. - - - - - Indicates whether to check if a queue exists before writing to it. - - - - - Layout used to format log messages. - - - - - Encoding to be used when writing text to the queue. - - - - - Name of the queue to write to. - - - - - Indicates whether to use recoverable messages (with guaranteed delivery). - - - - - Indicates whether to create the queue if it doesn't exists. - - - - - Label to associate with each message. - - - - - - - - - - - - - - - - - Name of the target. - - - - - Method name. The method must be public and static. - - - - - Class name. - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Layout used to format log messages. - - - - - Encoding to be used. - - - - - Indicates whether to keep connection open whenever possible. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Network address. - - - - - Maximum queue size. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to append newline at the end of log message. - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Maximum message size in bytes. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - Indicates whether to keep connection open whenever possible. - - - - - Maximum queue size. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include stack contents. - - - - - NDC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to perform layout calculation. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Name of the performance counter. - - - - - Performance counter type. - - - - - Performance counter instance name. - - - - - Indicates whether performance counter should be automatically created. - - - - - Name of the performance counter category. - - - - - Counter help text. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Default filter to be applied when no specific rule matches. - - - - - - - - - - - - - Condition to be tested. - - - - - Resulting filter to be applied when the condition matches. - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - Name of the target. - - - - - Number of times to repeat each log message. - - - - - - - - - - - - - - - - Name of the target. - - - - - Time to wait between retries in milliseconds. - - - - - Number of retries that should be attempted on the wrapped target in case of a failure. - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Indicates whether the created form will be initially minimized. - - - - - Maximum number of lines the rich text box will store (or 0 to disable this feature). - - - - - Initial width of the form with rich text box. - - - - - Indicates whether the created window will be a tool window. - - - - - Name of RichTextBox to which Nlog will write. - - - - - Indicates whether scroll bar will be moved automatically to show most recent log entries. - - - - - Initial height of the form with rich text box. - - - - - Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one. - - - - - Indicates whether to use default coloring rules. - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing texts. - - - - - Regular expression to be matched. You must specify either text or regex. - - - - - Text to be matched. You must specify either text or regex. - - - - - Indicates whether to match whole words only. - - - - - Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed. - - - - - Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed. - - - - - Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing. - - - - - - - - - - - - - Condition that must be met in order to set the specified font color. - - - - - Background color. - - - - - Font color. - - - - - Font style of matched text. - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - Name of the target. - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Web service URL. - - - - - Web service namespace. - - - - - Protocol to be used when calling web service. - - - - - Web service method name. - - - - - Encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Body layout (can be repeated multiple times). - - - - - Header layout. - - - - - Footer layout. - - - - - Quote Character. - - - - - Quoting mode. - - - - - Indicates whether CVS should include header. - - - - - Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). - - - - - Column delimiter. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Layout of the column. - - - - - Name of the column. - - - - - - - - - - - - - - Body layout (can be repeated multiple times). - - - - - Header layout. - - - - - Footer layout. - - - - - - - - - - - - - - - - - - - - - Layout text. - - - - - - - - - - - - - - - Condition expression. - - - - - Action to be taken when filter matches. - - - - - - - - - - - - - - - - - - - - - - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - - - - - - - - - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - - - - - - - - - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - - \ No newline at end of file diff --git a/src/NzbDrone.Update/NzbDrone.Update.csproj b/src/NzbDrone.Update/NzbDrone.Update.csproj index 5d4619f44..8adc9b5cb 100644 --- a/src/NzbDrone.Update/NzbDrone.Update.csproj +++ b/src/NzbDrone.Update/NzbDrone.Update.csproj @@ -41,11 +41,12 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - @@ -65,9 +66,6 @@ - - Designer - @@ -85,4 +83,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.Update/UpdateApp.cs b/src/NzbDrone.Update/UpdateApp.cs index 12e157344..6cb1c0ab4 100644 --- a/src/NzbDrone.Update/UpdateApp.cs +++ b/src/NzbDrone.Update/UpdateApp.cs @@ -46,7 +46,7 @@ namespace NzbDrone.Update } catch (Exception e) { - Logger.FatalException("An error has occurred while applying update package.", e); + Logger.Fatal(e, "An error has occurred while applying update package."); } } diff --git a/src/NzbDrone.Update/UpdateEngine/BackupAppData.cs b/src/NzbDrone.Update/UpdateEngine/BackupAppData.cs index 6732907a7..5ab0d09f4 100644 --- a/src/NzbDrone.Update/UpdateEngine/BackupAppData.cs +++ b/src/NzbDrone.Update/UpdateEngine/BackupAppData.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Update.UpdateEngine } catch (Exception e) { - _logger.ErrorException("Couldn't create a data backup", e); + _logger.Error(e, "Couldn't create a data backup"); } } } diff --git a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs index 09ddeee7e..f7ad19b28 100644 --- a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs +++ b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs @@ -109,7 +109,7 @@ namespace NzbDrone.Update.UpdateEngine } catch (Exception e) { - _logger.FatalException("Failed to copy upgrade package to target folder.", e); + _logger.Fatal(e, "Failed to copy upgrade package to target folder."); _backupAndRestore.Restore(installationFolder); } } diff --git a/src/NzbDrone.Update/UpdateEngine/TerminateNzbDrone.cs b/src/NzbDrone.Update/UpdateEngine/TerminateNzbDrone.cs index 2033ec2d2..45a584919 100644 --- a/src/NzbDrone.Update/UpdateEngine/TerminateNzbDrone.cs +++ b/src/NzbDrone.Update/UpdateEngine/TerminateNzbDrone.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Update.UpdateEngine } catch (Exception e) { - _logger.ErrorException("couldn't stop service", e); + _logger.Error(e, "couldn't stop service"); } } diff --git a/src/NzbDrone.Update/packages.config b/src/NzbDrone.Update/packages.config index 58e32fb45..c21c73eb4 100644 --- a/src/NzbDrone.Update/packages.config +++ b/src/NzbDrone.Update/packages.config @@ -1,6 +1,5 @@  - - + \ No newline at end of file diff --git a/src/NzbDrone.Windows/DiskProvider.cs b/src/NzbDrone.Windows/DiskProvider.cs index 7759fa062..c82a1f17d 100644 --- a/src/NzbDrone.Windows/DiskProvider.cs +++ b/src/NzbDrone.Windows/DiskProvider.cs @@ -112,7 +112,7 @@ namespace NzbDrone.Windows } catch (Exception ex) { - Logger.DebugException(string.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); + Logger.Debug(ex, string.Format("Hardlink '{0}' to '{1}' failed.", source, destination)); return false; } } diff --git a/src/NzbDrone.Windows/NzbDrone.Windows.csproj b/src/NzbDrone.Windows/NzbDrone.Windows.csproj index 7e708c851..08ad8a793 100644 --- a/src/NzbDrone.Windows/NzbDrone.Windows.csproj +++ b/src/NzbDrone.Windows/NzbDrone.Windows.csproj @@ -50,6 +50,10 @@ MinimumRecommendedRules.ruleset + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + @@ -57,24 +61,21 @@ - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - - - - {f2be0fdf-6e47-4827-a420-dd4ef82407f8} NzbDrone.Common + + + - + \ No newline at end of file diff --git a/src/NzbDrone.Windows/packages.config b/src/NzbDrone.Windows/packages.config index d5e3be0f3..6645420b9 100644 --- a/src/NzbDrone.Windows/packages.config +++ b/src/NzbDrone.Windows/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/NzbDrone/NzbDrone.csproj b/src/NzbDrone/NzbDrone.csproj index 04e416915..9ab3ec4a4 100644 --- a/src/NzbDrone/NzbDrone.csproj +++ b/src/NzbDrone/NzbDrone.csproj @@ -75,13 +75,14 @@ False ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll + + ..\packages\NLog.4.2.3\lib\net40\NLog.dll + True + - - ..\packages\NLog.2.1.0\lib\net40\NLog.dll - ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -171,4 +172,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone/WindowsApp.cs b/src/NzbDrone/WindowsApp.cs index 2beeca7e9..b99f3d134 100644 --- a/src/NzbDrone/WindowsApp.cs +++ b/src/NzbDrone/WindowsApp.cs @@ -29,7 +29,7 @@ namespace NzbDrone } catch (Exception e) { - Logger.FatalException("EPIC FAIL: " + e.Message, e); + Logger.Fatal(e, "EPIC FAIL: " + e.Message); var message = string.Format("{0}: {1}", e.GetType().Name, e.Message); MessageBox.Show(text: message, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!"); } diff --git a/src/NzbDrone/packages.config b/src/NzbDrone/packages.config index e4fc59a0b..9a1a2a3f1 100644 --- a/src/NzbDrone/packages.config +++ b/src/NzbDrone/packages.config @@ -3,6 +3,6 @@ - + - + \ No newline at end of file