Skip to content

Instantly share code, notes, and snippets.

@kerslake
Created August 27, 2014 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerslake/bbe6a84e9aa9841eec29 to your computer and use it in GitHub Desktop.
Save kerslake/bbe6a84e9aa9841eec29 to your computer and use it in GitHub Desktop.
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