Manually logged ELMAH errors aren't sending email

312 views Asked by At

I'm manually logging certain errors like this:

ApplicationException ex = new ApplicationException("Testing");

Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(new Elmah.Error(ex));

The unhandled exceptions are sending email, but the manually logged ones are not. I've also tried this:

Elmah.ErrorSignal.FromCurrentContext().Raise(ex);

How do I get these manually logged errors to send email (without throwing and showing a custom error page)?

1

There are 1 answers

0
nmit026 On BEST ANSWER

I spoke too soon.

This doesn't send email:

Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(new Elmah.Error(ex));

But this does:

Elmah.ErrorSignal.FromCurrentContext().Raise(ex);