public ActionResult Exceptions(string log, bool truncate = true) { var errors = ExceptionStores.GetAllErrors(log, log.HasValue() ? 1000 : 200); var vd = new ExceptionsModel { SelectedLog = log, TruncateErrors = truncate, Applications = ExceptionStores.Applications, Errors = errors }; return View(vd); }
public ActionResult ExceptionsSimilar(string app, Guid id, bool truncate = true, bool byTime = false) { var e = ExceptionStores.GetError(app, id); if (e == null) return View("Exceptions.Detail", null); var errors = ExceptionStores.GetSimilarErrors(e, byTime); var vd = new ExceptionsModel { Exception = e, SelectedLog = app, TruncateErrors = truncate, ShowingWindow = byTime, Applications = ExceptionStores.Applications, Errors = errors }; return View("Exceptions.Similar", vd); }
public ExceptionsModel GetExceptionsModel(string log, ExceptionSorts sort, int? count = null, Guid? prevLast = null, int? loadAsync = null) { var errors = ExceptionStores.GetAllErrors(log, sort: sort); var startIndex = 0; if (prevLast.HasValue) { startIndex = errors.FindIndex(e => e.GUID == prevLast.Value); if (startIndex > 0 && startIndex < errors.Count) startIndex++; } errors = errors.Skip(startIndex).Take(count ?? 500).ToList(); var vd = new ExceptionsModel { Sort = sort, SelectedLog = log, LoadAsyncSize = loadAsync.GetValueOrDefault(), Applications = ExceptionStores.Applications, Errors = errors.ToList() }; return vd; }
public ActionResult ExceptionsSearch(string q, string log, bool showDeleted = false) { // empty searches go back to the main log if (q.IsNullOrEmpty()) return RedirectToAction("Exceptions", new { log }); var errors = ExceptionStores.FindErrors(q, log, includeDeleted: showDeleted, max: 2000); if (!errors.Any() && !showDeleted) { // If we didn't find any current errors, go ahead and search deleted as well return RedirectToAction("ExceptionsSearch", new { q, log, showDeleted = true }); } var vd = new ExceptionsModel { Search = q, SelectedLog = log, ShowDeleted = showDeleted, TruncateErrors = true, Applications = ExceptionStores.Applications, Errors = errors }; return View("Exceptions.Search", vd); }
public ActionResult ExceptionsSimilar(string log, Guid id, ExceptionSorts? sort = null, bool truncate = true, bool byTime = false) { // Defaults sort = sort ?? ExceptionSorts.TimeDesc; log = GetLogName(log); var e = ExceptionStores.GetError(log, id); if (e == null) return View("Exceptions.Detail", null); var errors = ExceptionStores.GetSimilarErrors(e, byTime, sort: sort.Value); var vd = new ExceptionsModel { Sort = sort.Value, Exception = e, SelectedLog = log, ShowingWindow = byTime, Applications = ExceptionStores.Applications, ClearLinkForVisibleOnly = true, Errors = errors }; return View("Exceptions.Similar", vd); }
public ActionResult ExceptionsSearch(string q, string log, ExceptionSorts? sort = null, bool showDeleted = false) { // Defaults sort = sort ?? ExceptionSorts.TimeDesc; log = GetLogName(log); // empty searches go back to the main log if (q.IsNullOrEmpty()) return RedirectToAction("Exceptions", new { log }); var errors = ExceptionStores.FindErrors(q, log, includeDeleted: showDeleted, max: 2000, sort: sort.Value); if (!errors.Any() && !showDeleted) { // If we didn't find any current errors, go ahead and search deleted as well return RedirectToAction("ExceptionsSearch", new { q, log, showDeleted = true }); } var vd = new ExceptionsModel { Sort = sort.Value, Search = q, SelectedLog = log, ShowDeleted = showDeleted, Applications = ExceptionStores.Applications, ClearLinkForVisibleOnly = true, Errors = errors }; return View("Exceptions.Search", vd); }