private async void btnTraceAwait_Click(object sender, EventArgs e) { lblTraceIC.Text = "logging..."; var response = await ErrorReporter.ReportTrace("Random Trace 2", strDetails : "these are more details"); if (response.Success) { lblTraceIC.Text = response.IncidentCode; } else { lblTraceIC.Text = response.Message; } }
public ActionResult Trace(string message, string messageType) { if (messageType.ToLower() == "trace") { ErrorReporter.ReportTrace(message); ViewBag.Message = "Trace message stored."; } else if (messageType.ToLower() == "warning") { ErrorReporter.ReportWarning(message); ViewBag.Message = "Warning message stored."; } else if (messageType.ToLower() == "audit") { ErrorReporter.ReportAudit(message); ViewBag.Message = "Audit message stored."; } return(View("Index")); }
public async Task TestCode() { var context = new ApplicationContext(strClientID: "Organization ID/Name", strUserType: "UserType", strUserID: "UserID"); await ErrorReporter.ReportError("Error 1", context, intSeverity : 8, intDuration : 1234); await ErrorReporter.ReportError("Error 2"); await ErrorReporter.ReportAudit("Audit 1", context, strDetails : "This is what happened in detail", intDuration : 3333); await ErrorReporter.ReportAudit("Audit 2"); await ErrorReporter.ReportTrace("Trace 1", context, strDetails : "Details", strMethodName : System.Reflection.MethodBase.GetCurrentMethod().Name, intDuration : 2222); await ErrorReporter.ReportTrace("Trace 2"); await ErrorReporter.ReportWarning("Warning 1", context, strDetails : "A file couldn't be loaded, restoring from cache", strFileName : "File.jpg", intDuration : 1111); await ErrorReporter.ReportWarning("Warning 2"); }
public Form1() { InitializeComponent(); ErrorReporter.ReportTrace("Loading Test Form App for Error Logger"); }