Created
August 27, 2014 09:31
-
-
Save kerslake/bbe6a84e9aa9841eec29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NewRelicLogger | |
{ | |
public static void LogError(Exception ex, ErrorAction actionTaken, object parameters) | |
{ | |
/* code omitted */ | |
var errorDetails = Create(ex, ex.Message, ex.StackTrace, actionTaken, parameters); | |
LogToNewRelic(errorDetails); | |
/* code omitted */ | |
} | |
private static ErrorDetails Create( | |
Exception ex, | |
string errorMessage, | |
string stackTrace, | |
ErrorAction actionTaken, | |
object parameters) | |
{ | |
/* code omitted */ | |
} | |
private static void LogToNewRelic(ErrorDetails details) | |
{ | |
/* code omitted */ | |
// Log error to New Relic using API agent | |
NewRelic.NoticeError(details.Error, errorData); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment