Updated NLog to v4.2.3.

This commit is contained in:
Taloth Saldono 2016-02-11 22:13:42 +01:00
parent e01b2ef25c
commit 6a90035a4c
144 changed files with 305 additions and 5579 deletions

View File

@ -51,8 +51,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="NLog"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -79,6 +80,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="fastJSON\license.txt" /> <None Include="fastJSON\license.txt" />
<None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
</packages> </packages>

View File

@ -26,7 +26,7 @@ namespace NzbDrone.Api.ErrorManagement
if (apiException != null) if (apiException != null)
{ {
_logger.WarnException("API Error", apiException); _logger.Warn(apiException, "API Error");
return apiException.ToErrorResponse(); return apiException.ToErrorResponse();
} }
@ -65,10 +65,10 @@ namespace NzbDrone.Api.ErrorManagement
var sqlErrorMessage = string.Format("[{0} {1}]", context.Request.Method, context.Request.Path); 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 return new ErrorModel
{ {

View File

@ -60,7 +60,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Unable to gzip response", ex); _logger.Error(ex, "Unable to gzip response");
throw; throw;
} }
} }

View File

@ -68,7 +68,7 @@ namespace NzbDrone.Api.Indexers
} }
catch (ReleaseDownloadException ex) catch (ReleaseDownloadException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed"); throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
} }
@ -96,7 +96,7 @@ namespace NzbDrone.Api.Indexers
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Episode search failed: " + ex.Message, ex); _logger.Error(ex, "Episode search failed: " + ex.Message);
} }
return new List<ReleaseResource>(); return new List<ReleaseResource>();

View File

@ -59,6 +59,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
@ -66,9 +70,6 @@
<Reference Include="DDay.iCal"> <Reference Include="DDay.iCal">
<HintPath>..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath> <HintPath>..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Omu.ValueInjecter"> <Reference Include="Omu.ValueInjecter">
<HintPath>..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll</HintPath> <HintPath>..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll</HintPath>
</Reference> </Reference>

View File

@ -6,6 +6,6 @@
<package id="Nancy.Authentication.Basic" version="0.23.2" targetFramework="net40" /> <package id="Nancy.Authentication.Basic" version="0.23.2" targetFramework="net40" />
<package id="Nancy.Authentication.Forms" version="0.23.2" targetFramework="net40" /> <package id="Nancy.Authentication.Forms" version="0.23.2" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" /> <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="ValueInjecter" version="2.3.3" targetFramework="net40" /> <package id="ValueInjecter" version="2.3.3" targetFramework="net40" />
</packages> </packages>

View File

@ -45,6 +45,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -60,9 +64,6 @@
<Reference Include="Moq"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ContainerFixture.cs" /> <Compile Include="ContainerFixture.cs" />

View File

@ -3,6 +3,6 @@
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" /> <package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" /> <package id="NBuilder" version="3.0.1.1" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" /> <package id="NUnit" version="2.6.3" targetFramework="net40" />
</packages> </packages>

View File

@ -46,6 +46,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -58,9 +62,6 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="WebDriver, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="WebDriver, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll</HintPath> <HintPath>..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll</HintPath>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" /> <package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" /> <package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="Selenium.Support" version="2.48.0" targetFramework="net40" /> <package id="Selenium.Support" version="2.48.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.48.0" targetFramework="net40" /> <package id="Selenium.WebDriver" version="2.48.0" targetFramework="net40" />

View File

@ -45,6 +45,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -60,9 +64,6 @@
<Reference Include="Moq"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CacheTests\CachedFixture.cs" /> <Compile Include="CacheTests\CachedFixture.cs" />

View File

@ -2,6 +2,6 @@
<packages> <packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" /> <package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" /> <package id="NUnit" version="2.6.3" targetFramework="net40" />
</packages> </packages>

View File

@ -304,7 +304,7 @@ namespace NzbDrone.Common.Disk
} }
catch (Exception e) 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; throw;
} }
@ -394,7 +394,7 @@ namespace NzbDrone.Common.Disk
} }
catch (Exception ex) 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; return null;
} }
} }

View File

@ -259,7 +259,7 @@ namespace NzbDrone.Common.Disk
} }
catch (Exception ex) 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) 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) 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));
} }
} }

View File

@ -43,7 +43,7 @@ namespace NzbDrone.Common.EnvironmentInfo
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.WarnException("Coudn't set app folder permission", ex); _logger.Warn(ex, "Coudn't set app folder permission");
} }
} }
} }

View File

@ -60,7 +60,7 @@ namespace NzbDrone.Common.EnvironmentInfo
} }
catch (Exception ex) 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; return false;
} }
} }

View File

@ -29,7 +29,7 @@ namespace NzbDrone.Common.Http.Dispatchers
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.TraceException("Initializing curl failed", ex); _logger.Trace(ex, "Initializing curl failed");
return false; return false;
} }
} }

View File

@ -177,7 +177,7 @@ namespace NzbDrone.Common.Http
} }
catch (Exception e) catch (Exception e)
{ {
_logger.WarnException("Failed to get response from: " + url, e); _logger.Warn(e, "Failed to get response from: " + url);
throw; throw;
} }
} }

View File

@ -53,7 +53,7 @@ namespace NzbDrone.Common.Http
} }
catch (Exception e) catch (Exception e)
{ {
_logger.WarnException("Failed to get response from: " + url, e); _logger.Warn(e, "Failed to get response from: " + url);
throw; throw;
} }
} }

View File

@ -19,7 +19,7 @@ namespace NzbDrone.Common.Instrumentation
var exception = e.Exception; var exception = e.Exception;
Console.WriteLine("Task Error: {0}", 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) private static void HandleAppDomainException(object sender, UnhandledExceptionEventArgs e)
@ -40,13 +40,13 @@ namespace NzbDrone.Common.Instrumentation
if (exception is TypeInitializationException && exception.InnerException is DllNotFoundException || if (exception is TypeInitializationException && exception.InnerException is DllNotFoundException ||
exception is DllNotFoundException) exception is DllNotFoundException)
{ {
Logger.DebugException("Minor Fail: " + exception.Message, exception); Logger.Debug(exception, "Minor Fail: " + exception.Message);
return; return;
} }
} }
Console.WriteLine("EPIC FAIL: {0}", exception); Console.WriteLine("EPIC FAIL: {0}", exception);
Logger.FatalException("EPIC FAIL: " + exception.Message, exception); Logger.Fatal(exception, "EPIC FAIL: " + exception.Message);
} }
} }
} }

View File

@ -43,6 +43,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" /> <Reference Include="System.Configuration.Install" />
@ -53,9 +57,6 @@
<Reference Include="ICSharpCode.SharpZipLib"> <Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll</HintPath> <HintPath>..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
</ItemGroup> </ItemGroup>

View File

@ -37,7 +37,7 @@ namespace NzbDrone.Common.Processes
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Unable to write PID file: " + filename, ex); _logger.Error(ex, "Unable to write PID file: " + filename);
throw; throw;
} }
} }

View File

@ -292,7 +292,7 @@ namespace NzbDrone.Common.Processes
} }
catch (Win32Exception e) 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; return processInfo;

View File

@ -17,7 +17,7 @@ namespace NzbDrone.Common.TPL
var aggregateException = t.Exception.Flatten(); var aggregateException = t.Exception.Flatten();
foreach (var exception in aggregateException.InnerExceptions) foreach (var exception in aggregateException.InnerExceptions)
{ {
Logger.ErrorException("Task Error", exception); Logger.Error(exception, "Task Error");
} }
} }
}, TaskContinuationOptions.OnlyOnFaulted); }, TaskContinuationOptions.OnlyOnFaulted);

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="ICSharpCode.SharpZipLib.Patched" version="0.86.5" targetFramework="net40" /> <package id="ICSharpCode.SharpZipLib.Patched" version="0.86.5" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
</packages> </packages>

View File

@ -32,7 +32,7 @@ namespace NzbDrone.Console
{ {
System.Console.WriteLine(""); System.Console.WriteLine("");
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.WriteLine("Press any key to exit...");
System.Console.ReadLine(); System.Console.ReadLine();
Environment.Exit(1); Environment.Exit(1);

View File

@ -75,11 +75,12 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Owin"> <Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference> </Reference>

View File

@ -3,6 +3,6 @@
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net40" /> <package id="Microsoft.Owin" version="2.1.0" targetFramework="net40" />
<package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net40" /> <package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" /> <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="Owin" version="1.0" targetFramework="net40" /> <package id="Owin" version="1.0" targetFramework="net40" />
</packages> </packages>

View File

@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.InstrumentationTests
{ {
var ex = new InvalidOperationException("Fake Exception"); var ex = new InvalidOperationException("Fake Exception");
_logger.ErrorException(_uniqueMessage, ex); _logger.Error(ex, _uniqueMessage);
VerifyLog(StoredModel, LogLevel.Error); VerifyLog(StoredModel, LogLevel.Error);
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Test.InstrumentationTests
_uniqueMessage = string.Empty; _uniqueMessage = string.Empty;
_logger.ErrorException(_uniqueMessage, ex); _logger.Error(ex, _uniqueMessage);
StoredModel.Message.Should().Be(ex.Message); StoredModel.Message.Should().Be(ex.Message);

View File

@ -68,6 +68,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -96,9 +100,6 @@
<Reference Include="NCrunch.Framework"> <Reference Include="NCrunch.Framework">
<HintPath>..\packages\NCrunch.Framework.1.46.0.9\lib\net35\NCrunch.Framework.dll</HintPath> <HintPath>..\packages\NCrunch.Framework.1.46.0.9\lib\net35\NCrunch.Framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Prowlin"> <Reference Include="Prowlin">
<HintPath>..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll</HintPath> <HintPath>..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll</HintPath>
</Reference> </Reference>

View File

@ -10,7 +10,7 @@
<package id="NBuilder" version="3.0.1.1" /> <package id="NBuilder" version="3.0.1.1" />
<package id="NCrunch.Framework" version="1.46.0.9" targetFramework="net40" /> <package id="NCrunch.Framework" version="1.46.0.9" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" /> <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" /> <package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" /> <package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" />
<package id="Unity" version="2.1.505.2" targetFramework="net40" /> <package id="Unity" version="2.1.505.2" targetFramework="net40" />

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.WarnException("Failed to get Daily Series", ex); _logger.Warn(ex, "Failed to get Daily Series");
return new List<int>(); return new List<int>();
} }
} }

View File

@ -139,7 +139,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Failed to Update Scene Mappings:", ex); _logger.Error(ex, "Failed to Update Scene Mappings:");
} }
} }

View File

@ -84,7 +84,7 @@ namespace NzbDrone.Core.DataAugmentation.Xem
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Error updating scene numbering mappings for: " + series, ex); _logger.Error(ex, "Error updating scene numbering mappings for: " + series);
} }
} }

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Datastore
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("An Error occurred while vacuuming database.", e); _logger.Error(e, "An Error occurred while vacuuming database.");
} }
} }
} }

View File

@ -47,7 +47,7 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
public void Error(Exception exception) public void Error(Exception exception)
{ {
_logger.ErrorException(exception.Message, exception); _logger.Error(exception, exception.Message);
} }
public void Write(string message, bool escaped) public void Write(string message, bool escaped)

View File

@ -95,7 +95,7 @@ namespace NzbDrone.Core.DecisionEngine
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("Couldn't process release.", e); _logger.Error(e, "Couldn't process release.");
} }
reportNumber++; reportNumber++;
@ -140,7 +140,7 @@ namespace NzbDrone.Core.DecisionEngine
{ {
e.Data.Add("report", remoteEpisode.Release.ToJson()); e.Data.Add("report", remoteEpisode.Release.ToJson());
e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.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)); return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message));
} }

View File

@ -91,7 +91,7 @@ namespace NzbDrone.Core.DiskSpace
{ {
if (!suppressWarnings) if (!suppressWarnings)
{ {
_logger.WarnException("Unable to get free space for: " + path, ex); _logger.Warn(ex, "Unable to get free space for: " + path);
} }
} }

View File

@ -100,7 +100,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -204,12 +204,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge
} }
catch (DownloadClientAuthenticationException ex) catch (DownloadClientAuthenticationException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Password", "Authentication failed"); return new NzbDroneValidationFailure("Password", "Authentication failed");
} }
catch (WebException ex) catch (WebException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
switch (ex.Status) switch (ex.Status)
{ {
case WebExceptionStatus.ConnectFailure: case WebExceptionStatus.ConnectFailure:
@ -233,7 +233,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
} }
@ -284,7 +284,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
} }
catch (Exception ex) 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); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
} }

View File

@ -172,7 +172,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to NZBVortex"); return new ValidationFailure("Host", "Unable to connect to NZBVortex");
} }
@ -193,7 +193,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to NZBVortex"); return new ValidationFailure("Host", "Unable to connect to NZBVortex");
} }

View File

@ -56,7 +56,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -120,7 +120,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -284,7 +284,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
{ {
return new ValidationFailure("Username", "Authentication failed"); 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"); return new ValidationFailure("Host", "Unable to connect to NZBGet");
} }

View File

@ -107,7 +107,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -267,7 +267,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to SABnzbd"); return new ValidationFailure("Host", "Unable to connect to SABnzbd");
} }

View File

@ -100,7 +100,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -218,7 +218,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
} }
catch (DownloadClientAuthenticationException ex) catch (DownloadClientAuthenticationException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure") 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." 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) catch (WebException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure) if (ex.Status == WebExceptionStatus.ConnectFailure)
{ {
return new NzbDroneValidationFailure("Host", "Unable to connect") return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -238,7 +238,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
} }
@ -253,7 +253,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
} }
catch (Exception ex) 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); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
} }

View File

@ -98,7 +98,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -230,7 +230,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
} }
catch (DownloadClientAuthenticationException ex) catch (DownloadClientAuthenticationException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure") return new NzbDroneValidationFailure("Username", "Authentication failure")
{ {
DetailedDescription = "Please verify your username and password." DetailedDescription = "Please verify your username and password."
@ -238,7 +238,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
} }
catch (WebException ex) catch (WebException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure) if (ex.Status == WebExceptionStatus.ConnectFailure)
{ {
return new NzbDroneValidationFailure("Host", "Unable to connect") return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -250,7 +250,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message);
} }
@ -265,7 +265,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
} }
catch (Exception ex) 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); return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message);
} }

View File

@ -159,7 +159,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -208,7 +208,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
} }
@ -223,7 +223,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
} }
catch (Exception ex) 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); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
} }

View File

@ -81,7 +81,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
} }
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>(); return Enumerable.Empty<DownloadClientItem>();
} }
@ -208,7 +208,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
} }
catch (DownloadClientAuthenticationException ex) catch (DownloadClientAuthenticationException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure") return new NzbDroneValidationFailure("Username", "Authentication failure")
{ {
DetailedDescription = "Please verify your username and password." DetailedDescription = "Please verify your username and password."
@ -216,7 +216,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
} }
catch (WebException ex) catch (WebException ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure) if (ex.Status == WebExceptionStatus.ConnectFailure)
{ {
return new NzbDroneValidationFailure("Host", "Unable to connect") return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -228,7 +228,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException(ex.Message, ex); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
} }
@ -243,7 +243,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
} }
catch (Exception ex) 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); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
} }

View File

@ -127,7 +127,7 @@ namespace NzbDrone.Core.Download
} }
catch (Exception ex) 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) 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)); failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
} }

View File

@ -74,7 +74,7 @@ namespace NzbDrone.Core.Download
} }
catch (Exception e) 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);
} }
} }
} }

View File

@ -78,7 +78,7 @@ namespace NzbDrone.Core.Download
{ {
//TODO: support for store & forward //TODO: support for store & forward
//We'll need to differentiate between a download client error and an indexer error //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);
} }
} }

View File

@ -130,15 +130,13 @@ namespace NzbDrone.Core.Download
} }
catch (HttpException ex) catch (HttpException ex)
{ {
_logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl);
remoteEpisode.Release.Title, torrentUrl), ex);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex);
} }
catch (WebException ex) catch (WebException ex)
{ {
_logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl);
remoteEpisode.Release.Title, torrentUrl), ex);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex);
} }
@ -168,8 +166,7 @@ namespace NzbDrone.Core.Download
} }
catch (FormatException ex) catch (FormatException ex)
{ {
_logger.ErrorException(string.Format("Failed to parse magnetlink for episode '{0}': '{1}'", _logger.Error(ex, "Failed to parse magnetlink for episode '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl);
remoteEpisode.Release.Title, magnetUrl), ex);
return null; return null;
} }

View File

@ -87,7 +87,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
} }
catch (Exception ex) 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) foreach (var downloadItem in downloadClientHistory)
@ -135,7 +135,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
} }
catch (Exception e) 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; return trackedDownloads;

View File

@ -93,7 +93,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
} }
catch (Exception e) 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; return null;
} }

View File

@ -53,15 +53,13 @@ namespace NzbDrone.Core.Download
} }
catch (HttpException ex) catch (HttpException ex)
{ {
_logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url);
remoteEpisode.Release.Title, url), ex);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex);
} }
catch (WebException ex) catch (WebException ex)
{ {
_logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url);
remoteEpisode.Release.Title, url), ex);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex);
} }

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
{ {
var message = String.Format("Unable to communicate with {0}.", downloadClient.Definition.Name); 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); return new HealthCheck(GetType(), HealthCheckResult.Error, message + " " + ex.Message);
} }
} }

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("Couldn't validate image " + image.RelativePath, e); _logger.Error(e, "Couldn't validate image " + image.RelativePath);
} }
} }
} }

View File

@ -37,7 +37,7 @@ namespace NzbDrone.Core.Housekeeping
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Error running housekeeping task: " + housekeeper.GetType().Name, ex); _logger.Error(ex, "Error running housekeeping task: " + housekeeper.GetType().Name);
} }
} }

View File

@ -57,7 +57,7 @@ namespace NzbDrone.Core.IndexerSearch
catch (Exception ex) catch (Exception ex)
{ {
var message = String.Format("Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key); 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; continue;
} }
} }
@ -71,7 +71,7 @@ namespace NzbDrone.Core.IndexerSearch
catch (Exception ex) catch (Exception ex)
{ {
var message = String.Format("Unable to search for missing episode: [{0}]", season.First()); var message = String.Format("Unable to search for missing episode: [{0}]", season.First());
_logger.ErrorException(message, ex); _logger.Error(ex, message);
continue; continue;
} }
} }

View File

@ -272,7 +272,7 @@ namespace NzbDrone.Core.IndexerSearch
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("Error while searching for " + criteriaBase, e); _logger.Error(e, "Error while searching for " + criteriaBase);
} }
}).LogExceptions()); }).LogExceptions());
} }

View File

@ -249,13 +249,13 @@ namespace NzbDrone.Core.Indexers
{ {
_indexerStatusService.RecordFailure(Definition.Id); _indexerStatusService.RecordFailure(Definition.Id);
var message = string.Format("{0} - {1}", ex.Message, url); var message = string.Format("{0} - {1}", ex.Message, url);
_logger.WarnException(message, ex); _logger.Warn(ex, message);
} }
catch (Exception feedEx) catch (Exception feedEx)
{ {
_indexerStatusService.RecordFailure(Definition.Id); _indexerStatusService.RecordFailure(Definition.Id);
feedEx.Data.Add("FeedUrl", url); 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); return CleanupReleases(releases);
@ -315,19 +315,19 @@ namespace NzbDrone.Core.Indexers
} }
catch (UnsupportedFeedException ex) 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); return new ValidationFailure(string.Empty, "Indexer feed is not supported: " + ex.Message);
} }
catch (IndexerException ex) 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); return new ValidationFailure(string.Empty, "Unable to connect to indexer. " + ex.Message);
} }
catch (Exception ex) 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"); return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
} }

View File

@ -106,7 +106,7 @@ namespace NzbDrone.Core.Indexers
} }
catch (Exception ex) 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)); failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
} }

View File

@ -120,7 +120,7 @@ namespace NzbDrone.Core.Indexers.Newznab
} }
catch (Exception ex) 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 new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
} }

View File

@ -56,7 +56,7 @@ namespace NzbDrone.Core.Indexers.Newznab
} }
catch (Exception ex) 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; return capabilities;

View File

@ -63,7 +63,7 @@ namespace NzbDrone.Core.Indexers
catch (Exception itemEx) catch (Exception itemEx)
{ {
itemEx.Data.Add("Item", item.Title()); 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) 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; return null;
} }
} }

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss
} }
catch (Exception ex) 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; return null;
} }
@ -100,7 +100,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss
} }
catch (Exception ex) 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; return null;
} }
} }
@ -233,7 +233,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss
} }
catch (Exception ex) 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); throw new UnsupportedFeedException("Unable to parse indexer: " + ex.Message);
} }
} }

View File

@ -111,12 +111,10 @@ namespace NzbDrone.Core.Indexers.Torznab
} }
catch (Exception ex) 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 new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
} }
return null;
} }
} }
} }

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers
} }
catch (FormatException e) catch (FormatException e)
{ {
Logger.WarnException("Unable to parse " + dateString, e); Logger.Warn(e, "Unable to parse " + dateString);
throw; throw;
} }
} }

View File

@ -103,7 +103,7 @@ namespace NzbDrone.Core.MediaCover
} }
catch (Exception e) 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); EnsureResizedCovers(series, cover, !alreadyExists);

View File

@ -155,8 +155,8 @@ namespace NzbDrone.Core.MediaFiles
catch (Exception ex) catch (Exception ex)
{ {
_logger.WarnException("Unable to apply permissions to: " + path, ex); _logger.Warn(ex, "Unable to apply permissions to: " + path);
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
} }
} }

View File

@ -135,7 +135,7 @@ namespace NzbDrone.Core.MediaFiles
catch (Exception ex) catch (Exception ex)
{ {
_logger.WarnException("Unable to set last write time", ex); _logger.Warn(ex, "Unable to set last write time");
} }
_mediaFileAttributeService.SetFilePermissions(destinationFilePath); _mediaFileAttributeService.SetFilePermissions(destinationFilePath);
@ -206,7 +206,7 @@ namespace NzbDrone.Core.MediaFiles
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.ErrorException("Unable to create directory: " + directoryName, ex); _logger.Error(ex, "Unable to create directory: " + directoryName);
} }
_mediaFileAttributeService.SetFolderPermissions(directoryName); _mediaFileAttributeService.SetFolderPermissions(directoryName);

View File

@ -114,7 +114,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
} }
catch (Exception e) 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")); importResults.Add(new ImportResult(importDecision, "Failed to import episode"));
} }
} }

View File

@ -111,7 +111,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("Couldn't import file. " + file, e); _logger.Error(e, "Couldn't import file. " + file);
} }
return decision; return decision;
@ -140,7 +140,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
{ {
//e.Data.Add("report", remoteEpisode.Report.ToJson()); //e.Data.Add("report", remoteEpisode.Report.ToJson());
//e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.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)); return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message));
} }

View File

@ -58,7 +58,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
} }
catch (Exception ex) 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(); return Decision.Accept();

View File

@ -43,12 +43,12 @@ namespace NzbDrone.Core.MediaFiles
if (ex is UnauthorizedAccessException || ex is InvalidOperationException || ex is FileNotFoundException) if (ex is UnauthorizedAccessException || ex is InvalidOperationException || ex is FileNotFoundException)
{ {
_logger.Debug("Unable to apply folder permissions to: ", path); _logger.Debug("Unable to apply folder permissions to: ", path);
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
} }
else else
{ {
_logger.Warn("Unable to apply folder permissions to: ", path); _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) catch (Exception ex)
{ {
_logger.WarnException("Unable to apply permissions to: " + path, ex); _logger.Warn(ex, "Unable to apply permissions to: " + path);
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
} }
} }
} }

View File

@ -69,7 +69,7 @@ namespace NzbDrone.Core.MediaFiles
catch (Exception ex) catch (Exception ex)
{ {
var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id);
_logger.ErrorException(errorMessage, ex); _logger.Error(ex, errorMessage);
} }
} }

View File

@ -151,11 +151,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
} }
catch (DllNotFoundException ex) 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) 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 finally
{ {

View File

@ -118,7 +118,7 @@ namespace NzbDrone.Core.MediaFiles
catch (IOException e) catch (IOException e)
{ {
var message = string.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination); var message = string.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination);
_logger.ErrorException(message, e); _logger.Error(e, message);
throw; throw;
} }

View File

@ -132,7 +132,7 @@ namespace NzbDrone.Core.MediaFiles
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Failed to rename file: " + episodeFilePath, ex); _logger.Error(ex, "Failed to rename file: " + episodeFilePath);
} }
} }

View File

@ -135,7 +135,7 @@ namespace NzbDrone.Core.MediaFiles
catch (Exception ex) 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) catch (Exception ex)
{ {
ex.ExceptronIgnoreOnMono(); ex.ExceptronIgnoreOnMono();
_logger.WarnException("Unable to set date of file [" + filePath + "]", ex); _logger.Warn(ex, "Unable to set date of file [" + filePath + "]");
} }
} }

View File

@ -42,18 +42,18 @@ namespace NzbDrone.Core.Messaging.Commands
} }
catch (Exception ex) 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) catch (ThreadAbortException ex)
{ {
_logger.ErrorException("Thread aborted: " + ex.Message, ex); _logger.Error(ex, "Thread aborted: " + ex.Message);
Thread.ResetAbort(); Thread.ResetAbort();
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Unknown error in thread: " + ex.Message, ex); _logger.Error(ex, "Unknown error in thread: " + ex.Message);
} }
} }

View File

@ -58,7 +58,7 @@ namespace NzbDrone.Core.Messaging.Events
} }
catch (Exception e) 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));
} }
} }

View File

@ -335,7 +335,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
} }
catch (Exception ex) 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<ImageFileResult>(); return new List<ImageFileResult>();
} }

View File

@ -380,7 +380,7 @@ namespace NzbDrone.Core.Metadata
} }
catch (Exception e) catch (Exception e)
{ {
_logger.ErrorException("Couldn't download image " + url + " for " + series, e); _logger.Error(e, "Couldn't download image " + url + " for " + series);
} }
} }

View File

@ -95,7 +95,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
} }
catch (Exception ex) 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); throw new SkyHookException("Search for '{0}' failed. Invalid response received from SkyHook.", title);
} }
} }

View File

@ -34,7 +34,7 @@ namespace NzbDrone.Core.Notifications.Boxcar
} }
catch (BoxcarException ex) 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"); throw new BoxcarException("Unable to send Boxcar notifications");
} }
} }
@ -53,16 +53,16 @@ namespace NzbDrone.Core.Notifications.Boxcar
{ {
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) 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"); 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"); return new ValidationFailure("Token", "Unable to send test message");
} }
catch (Exception ex) 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"); return new ValidationFailure("", "Unable to send test message");
} }
} }
@ -84,7 +84,7 @@ namespace NzbDrone.Core.Notifications.Boxcar
{ {
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) 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; throw;
} }

View File

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Notifications.Email
catch(Exception ex) catch(Exception ex)
{ {
_logger.Error("Error sending email. Subject: {0}", email.Subject); _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) catch (Exception ex)
{ {
_logger.ErrorException("There was an error sending an email.", ex); _logger.Error(ex, "There was an error sending an email.");
throw; throw;
} }
} }
@ -76,7 +76,7 @@ namespace NzbDrone.Core.Notifications.Email
} }
catch (Exception ex) 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"); return new ValidationFailure("Server", "Unable to send test email");
} }

View File

@ -152,7 +152,7 @@ namespace NzbDrone.Core.Notifications.Growl
} }
catch (Exception ex) 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 new ValidationFailure("Host", "Unable to send test message");
} }

View File

@ -52,7 +52,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
} }
catch (Exception ex) 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); return new ValidationFailure("Host", "Unable to send test message: " + ex.Message);
} }

View File

@ -107,7 +107,7 @@ namespace NzbDrone.Core.Notifications
catch (Exception ex) 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) 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) 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);
} }
} }
} }

View File

@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid
} }
catch (Exception ex) 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"); return new ValidationFailure("ApiKey", "Unable to send test message");
} }

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Notifications.Plex
} }
catch(Exception ex) 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) 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 new ValidationFailure("Host", "Unable to send test message");
} }

View File

@ -81,7 +81,7 @@ namespace NzbDrone.Core.Notifications.Plex
catch (SocketException ex) catch (SocketException ex)
{ {
var logMessage = string.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port); var logMessage = string.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port);
_logger.DebugException(logMessage, ex); _logger.Debug(ex, logMessage);
} }
} }
} }

View File

@ -52,7 +52,7 @@ namespace NzbDrone.Core.Notifications.Plex
catch(Exception ex) catch(Exception ex)
{ {
_logger.WarnException("Failed to Update Plex host: " + settings.Host, ex); _logger.Warn(ex, "Failed to Update Plex host: " + settings.Host);
throw; throw;
} }
} }
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Notifications.Plex
} }
catch (Exception ex) 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; return false;
@ -158,12 +158,12 @@ namespace NzbDrone.Core.Notifications.Plex
} }
catch(PlexAuthenticationException ex) 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"); return new ValidationFailure("Username", "Incorrect username or password");
} }
catch (Exception ex) 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"); return new ValidationFailure("Host", "Unable to connect to Plex Server");
} }

View File

@ -49,7 +49,7 @@ namespace NzbDrone.Core.Notifications.Prowl
catch (Exception ex) catch (Exception ex)
{ {
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
_logger.Warn("Invalid API Key: {0}", apiKey); _logger.Warn("Invalid API Key: {0}", apiKey);
} }
} }
@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.Prowl
catch (Exception ex) catch (Exception ex)
{ {
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
_logger.Warn("Invalid API Key: {0}", apiKey); _logger.Warn("Invalid API Key: {0}", apiKey);
throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid"); throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid");
} }
@ -94,7 +94,7 @@ namespace NzbDrone.Core.Notifications.Prowl
} }
catch (Exception ex) 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"); return new ValidationFailure("ApiKey", "Unable to send test message");
} }

View File

@ -41,7 +41,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
} }
catch (PushBulletException ex) 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; error = true;
} }
} }
@ -60,7 +60,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
} }
catch (PushBulletException ex) 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; error = true;
} }
} }
@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
} }
catch (PushBulletException ex) 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; error = true;
} }
} }
@ -100,16 +100,16 @@ namespace NzbDrone.Core.Notifications.PushBullet
{ {
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) 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"); 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"); return new ValidationFailure("ApiKey", "Unable to send test message");
} }
catch (Exception ex) 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"); return new ValidationFailure("", "Unable to send test message");
} }
@ -164,7 +164,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
{ {
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) 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; throw;
} }

View File

@ -73,30 +73,30 @@ namespace NzbDrone.Core.Notifications.Pushalot
{ {
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) 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"); return new ValidationFailure("AuthToken", "Authentication Token is invalid");
} }
if (ex.Response.StatusCode == HttpStatusCode.NotAcceptable) 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"); return new ValidationFailure("AuthToken", "Message limit reached");
} }
if (ex.Response.StatusCode == HttpStatusCode.Gone) 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."); return new ValidationFailure("AuthToken", "Authorization Token is no longer valid, please use a new one.");
} }
var response = Json.Deserialize<PushalotResponse>(ex.Response.Content); var response = Json.Deserialize<PushalotResponse>(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); return new ValidationFailure("AuthToken", response.Description);
} }
catch (Exception ex) 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"); return new ValidationFailure("", "Unable to send test message");
} }

View File

@ -59,7 +59,7 @@ namespace NzbDrone.Core.Notifications.Pushover
} }
catch (Exception ex) 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"); return new ValidationFailure("ApiKey", "Unable to send test message");
} }

View File

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Notifications.Synology
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.WarnException("synoindex not available", ex); _logger.Warn(ex, "synoindex not available");
return false; return false;
} }
} }

View File

@ -131,7 +131,7 @@ namespace NzbDrone.Core.Notifications.Twitter
} }
catch (Exception ex) 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 new ValidationFailure("Host", "Unable to send test message");
} }
return null; return null;

View File

@ -74,7 +74,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
catch (Exception ex) catch (Exception ex)
{ {
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
} }
return new List<ActivePlayer>(); return new List<ActivePlayer>();
@ -163,7 +163,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
catch (Exception ex) catch (Exception ex)
{ {
_logger.DebugException(ex.Message, ex); _logger.Debug(ex, ex.Message);
} }
} }

Some files were not shown because too many files have changed in this diff Show More