diff --git a/src/NzbDrone.Core/Applications/ApplicationService.cs b/src/NzbDrone.Core/Applications/ApplicationService.cs index 097b701d1..97e627fd9 100644 --- a/src/NzbDrone.Core/Applications/ApplicationService.cs +++ b/src/NzbDrone.Core/Applications/ApplicationService.cs @@ -252,11 +252,11 @@ namespace NzbDrone.Core.Applications if (webException.Message.Contains("502") || webException.Message.Contains("503") || webException.Message.Contains("timed out")) { - _logger.Warn("{0} server is currently unavailable. {1}", this, webException.Message); + _logger.Warn(webException, "{0} server is currently unavailable. {1}", this, webException.Message); } else { - _logger.Warn("{0} {1}", this, webException.Message); + _logger.Warn(webException, "{0} {1}", this, webException.Message); } } catch (TooManyRequestsException ex) @@ -264,12 +264,12 @@ namespace NzbDrone.Core.Applications var minimumBackOff = ex.RetryAfter != TimeSpan.Zero ? ex.RetryAfter : TimeSpan.FromHours(1); _applicationStatusService.RecordFailure(application.Definition.Id, minimumBackOff); - _logger.Warn("API Request Limit reached for {0}", this); + _logger.Warn(ex, "API Request Limit reached for {0}", this); } catch (HttpException ex) { _applicationStatusService.RecordFailure(application.Definition.Id); - _logger.Warn("{0} {1}", this, ex.Message); + _logger.Warn(ex, "{0} {1}", this, ex.Message); } catch (Exception ex) { @@ -301,11 +301,11 @@ namespace NzbDrone.Core.Applications if (webException.Message.Contains("502") || webException.Message.Contains("503") || webException.Message.Contains("timed out")) { - _logger.Warn("{0} server is currently unavailable. {1}", this, webException.Message); + _logger.Warn(webException, "{0} server is currently unavailable. {1}", this, webException.Message); } else { - _logger.Warn("{0} {1}", this, webException.Message); + _logger.Warn(webException, "{0} {1}", this, webException.Message); } } catch (TooManyRequestsException ex) @@ -313,12 +313,12 @@ namespace NzbDrone.Core.Applications var minimumBackOff = ex.RetryAfter != TimeSpan.Zero ? ex.RetryAfter : TimeSpan.FromHours(1); _applicationStatusService.RecordFailure(application.Definition.Id, minimumBackOff); - _logger.Warn("API Request Limit reached for {0}", this); + _logger.Warn(ex, "API Request Limit reached for {0}", this); } catch (HttpException ex) { _applicationStatusService.RecordFailure(application.Definition.Id); - _logger.Warn("{0} {1}", this, ex.Message); + _logger.Warn(ex, "{0} {1}", this, ex.Message); } catch (Exception ex) { diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index ed25df68c..ab921a1a7 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -388,11 +388,11 @@ namespace NzbDrone.Core.Indexers if (webException.Message.Contains("502") || webException.Message.Contains("503") || webException.Message.Contains("504") || webException.Message.Contains("timed out")) { - _logger.Warn("{0} server is currently unavailable. {1} {2}", this, url, webException.Message); + _logger.Warn(webException, "{0} server is currently unavailable. {1} {2}", this, url, webException.Message); } else { - _logger.Warn("{0} {1} {2}", this, url, webException.Message); + _logger.Warn(webException, "{0} {1} {2}", this, url, webException.Message); } } catch (TooManyRequestsException ex) @@ -402,7 +402,7 @@ namespace NzbDrone.Core.Indexers var retryTime = ex.RetryAfter != TimeSpan.Zero ? ex.RetryAfter : minimumBackoff; _indexerStatusService.RecordFailure(Definition.Id, retryTime); - _logger.Warn("Request Limit reached for {0}. Disabled for {1}", this, retryTime); + _logger.Warn(ex, "Request Limit reached for {0}. Disabled for {1}", this, retryTime); } catch (HttpException ex) { @@ -411,18 +411,18 @@ namespace NzbDrone.Core.Indexers if (ex.Response.HasHttpServerError) { - _logger.Warn("Unable to connect to {0} at [{1}]. Indexer's server is unavailable. Try again later. {2}", this, url, ex.Message); + _logger.Warn(ex, "Unable to connect to {0} at [{1}]. Indexer's server is unavailable. Try again later. {2}", this, url, ex.Message); } else { - _logger.Warn("{0} {1}", this, ex.Message); + _logger.Warn(ex, "{0} {1}", this, ex.Message); } } catch (RequestLimitReachedException ex) { result.Queries.Add(new IndexerQueryResult { Response = ex.Response.HttpResponse }); _indexerStatusService.RecordFailure(Definition.Id, minimumBackoff); - _logger.Warn("Request Limit reached for {0}. Disabled for {1}", this, minimumBackoff); + _logger.Warn(ex, "Request Limit reached for {0}. Disabled for {1}", this, minimumBackoff); } catch (IndexerAuthException ex) {