예제 #1
0
파일: Program.cs 프로젝트: gyantal/SqCore
 internal static void StrongAssertMessageSendingEventHandler(StrongAssertMessage p_msg)
 {
     Utils.Logger.Info("StrongAssertEmailSendingEventHandler()");
     if ((DateTime.UtcNow - gLastStrongAssertEmailTime).TotalMinutes > 30)   // don't send it in every minute, just after 30 minutes
     {
         new Email
         {
             ToAddresses = Utils.Configuration["Emails:Gyant"],
             Subject     = "SQ HealthMonitor: StrongAssert failed.",
             Body        = "SQ HealthMonitor: StrongAssert failed. " + p_msg.Message + "/" + p_msg.StackTrace,
             IsBodyHtml  = false
         }.Send();
         gLastStrongAssertEmailTime = DateTime.UtcNow;
     }
 }
예제 #2
0
파일: Program.cs 프로젝트: gyantal/SQLab
 internal static void StrongAssertEmailSendingEventHandler(StrongAssertMessage p_msg)
 {
     Utils.Logger.Info("StrongAssertEmailSendingEventHandler()");
     if ((DateTime.UtcNow - gLastStrongAssertEmailTime).TotalMinutes > 30)   // don't send it in every minute, just after 30 minutes
     {
         new Email
         {
             ToAddresses = Utils.Configuration["EmailGyantal"],
             Subject = "SQ HealthMonitor: StrongAssert failed.",
             Body = "SQ HealthMonitor: StrongAssert failed. " + p_msg.Message + "/" + p_msg.StackTrace,
             IsBodyHtml = false
         }.Send();
         gLastStrongAssertEmailTime = DateTime.UtcNow;
     }
 }
예제 #3
0
파일: Program.cs 프로젝트: gyantal/SQLab
 internal static void StrongAssertMessageSendingEventHandler(StrongAssertMessage p_msg)
 {
     Utils.Logger.Info("StrongAssertEmailSendingEventHandler()");
     HealthMonitorMessage.SendStrongAssert("Website.C#.StrongAssert", p_msg, HealthMonitorMessageID.ReportErrorFromSQLabWebsite);
 }
예제 #4
0
파일: Program.cs 프로젝트: gyantal/SqCore
 internal static void StrongAssertMessageSendingEventHandler(StrongAssertMessage p_msg)
 {
     gLogger.Info("StrongAssertEmailSendingEventHandler()");
     HealthMonitorMessage.SendAsync($"Msg from SqCore.Website.C#.StrongAssert. StrongAssert Warning (if Severity is NoException, it is just a mild Warning. If Severity is ThrowException, that exception triggers a separate message to HealthMonitor as an Error). Severity: {p_msg.Severity}, Message: { p_msg.Message}, StackTrace: { p_msg.StackTrace.ToStringWithShortenedStackTrace(1600)}", HealthMonitorMessageID.SqCoreWebCsError).TurnAsyncToSyncTask();
 }
예제 #5
0
 public static void SendStrongAssert(string p_locationMsg, StrongAssertMessage p_msg, HealthMonitorMessageID p_healthMonId)
 {
     Send(p_locationMsg, $"StrongAssert. Severity: {p_msg.Severity}, Message { p_msg.Message}, StackTrace: { p_msg.StackTrace}", p_healthMonId);
 }