public IActionResult Index() { ElmahExtensions.RiseError(new InvalidOperationException("This is the Test Exception from code.")); _logger.LogTrace("Test"); _logger.LogDebug("Test"); _logger.LogError("Test"); _logger.LogInformation("Test"); _logger.LogWarning("Test"); _logger.LogCritical(new InvalidOperationException("Test"), "Test"); ElmahExtensions.RiseError(new NullReferenceException()); if (DateTime.Now.Millisecond < 500) { string str = null; // ReSharper disable once PossibleNullReferenceException foreach (var cc in str) { Debug.WriteLine(cc); } } var r = 0; // ReSharper disable once UnusedVariable // ReSharper disable once IntDivisionByZero var d = 100 / r; return(View()); }
/// inheritDoc public void HandleEvent(AbpHandledExceptionData eventData) { if (eventData.Exception != null && !eventData.Exception.IsExceptionLogged()) { ElmahExtensions.RiseError(eventData.Exception); eventData.Exception.MarkExceptionAsLogged(); } }
public async Task <bool> tryCommitAsync() { try { await commitAsync(); } catch (Exception e) { ElmahExtensions.RiseError(e); new InvalidOperationException("exception", e); return(false); } return(true); }
public async Task Invoke(HttpContext context) { try { await _next.Invoke(context); } catch (Exception ex) { ElmahExtensions.RiseError(new Exception(ex.Message, ex.InnerException)); } }
protected override void Append(LoggingEvent loggingEvent) { var exception = loggingEvent.ExceptionObject; if (exception == null || loggingEvent.ExceptionObject.IsExceptionLogged()) { return; } ElmahExtensions.RiseError(exception); }
public IActionResult Index() { /*_logger.LogTrace("Test"); * _logger.LogDebug("Test"); * _logger.LogError("Test"); * _logger.LogInformation("Test"); * _logger.LogWarning("Test");*/ _logger.LogCritical(new InvalidOperationException("Test"), "Test"); ElmahExtensions.RiseError(new Exception("test2")); var r = 0; // ReSharper disable once UnusedVariable // ReSharper disable once IntDivisionByZero var d = 100 / r; return(View()); }
public static void ManageExceptionContext(Exception ex) { ElmahExtensions.RiseError(ex); }