Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Merge logging fixes to master (#103)
Browse files Browse the repository at this point in the history
* Fix logging to properly attach exception info in Stats.ImportAzureCdnStatistics catch-all blocks (#102)

* Fix logging message
  • Loading branch information
xavierdecoster authored Feb 8, 2017
1 parent 68d9b5a commit dde504d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Stats.AzureCdnLogs.Common/LogEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ public class LogEvents
public static EventId InvalidRawLogFileName = new EventId(511, "Invalid raw log filename");
public static EventId FailedToGetFtpResponse = new EventId(512, "Failed to get FTP response");
public static EventId JobRunFailed = new EventId(550, "Job run failed");
public static EventId JobInitFailed = new EventId(551, "Job initialization failed");
}
}
4 changes: 2 additions & 2 deletions src/Stats.ImportAzureCdnStatistics/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public override bool Init(IDictionary<string, string> jobArgsDictionary)
}
catch (Exception exception)
{
_logger.LogCritical("Failed to initialize job! {Exception}", exception);
_logger.LogCritical(LogEvents.JobInitFailed, exception, "Failed to initialize job!");

return false;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public override async Task<bool> Run()
}
catch (Exception exception)
{
_logger.LogCritical("Job run failed! {Exception}", exception);
_logger.LogCritical(LogEvents.JobRunFailed, exception, "Job run failed!");

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Stats.ImportAzureCdnStatistics/LogFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private async Task DeleteSourceBlobAsync(ILeasedLogFile logFile)
}
catch (Exception exception)
{
_logger.LogError(LogEvents.FailedBlobDelete, exception, "Finished to delete blob {FtpBlobUri}", logFile.Uri);
_logger.LogError(LogEvents.FailedBlobDelete, exception, "Failed to delete blob {FtpBlobUri}", logFile.Uri);
ApplicationInsightsHelper.TrackException(exception, logFile.Blob.Name);
throw;
}
Expand Down

0 comments on commit dde504d

Please sign in to comment.