public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; var opts = AppErrorthAlerting.GetOptions(); context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(opts)); }
public dynamic SetAppErrOpts(int interval = 5, int errorCountLimit = 100, int errorGrowthLimit = 100, string emailReceivers = "") { //var interval = Convert.ToInt32(Request.Query["interval"]); //var errorCountLimit = Convert.ToInt32(Request.Query["errorCountLimit"]); //var errorGrowthLimit = Convert.ToInt32(Request.Query["errorGrowthLimit"]); //var emailReceivers = Request.Query["emailReceivers"]; AppErrorthAlerting.SetOptions(interval, errorCountLimit, errorGrowthLimit, emailReceivers); return("{'status':1}"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; var interval = Convert.ToInt32(context.Request["interval"]); var errorCountLimit = Convert.ToInt32(context.Request["errorCountLimit"]); var errorGrowthLimit = Convert.ToInt32(context.Request["errorGrowthLimit"]); var emailReceivers = context.Request["emailReceivers"]; AppErrorthAlerting.SetOptions(interval, errorCountLimit, errorGrowthLimit, emailReceivers); context.Response.Write("{'status':1}"); }
static void CheckAlerting() { while (true) { try { BaseAlerting alert = new AppErrorthAlerting(); alert.Alert(); } catch (ThreadAbortException tae) { Thread.ResetAbort(); FileLogger.Log(tae); } catch (Exception ex) { FileLogger.Log(ex); } finally { Thread.Sleep(1000 * 60); } } }
public dynamic GetAppErrOpts() { var opts = AppErrorthAlerting.GetOptions(); return(Newtonsoft.Json.JsonConvert.SerializeObject(opts)); }