Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow error mail report to be sent programmatically #27

Open
atifaziz opened this issue Aug 25, 2015 · 5 comments
Open

Allow error mail report to be sent programmatically #27

atifaziz opened this issue Aug 25, 2015 · 5 comments

Comments

@atifaziz
Copy link
Member

When the following code is executed:

Error error = new Error(ex, HttpContext.Current);
GotDotNet.Elmah.ErrorLog.Default.Log(error);

Include an option to perform the "errorMail" action either automatically when .Log() is called or by specifying that an email should be sent in the parameters.

See the discussion at:
http://groups.google.com/group/elmah/browse_thread/thread/b17cb4b5308b8013


Originally reported on Google Code with ID 27

Reported by dgarcia182 on 2007-08-02 22:33:16

@atifaziz
Copy link
Member Author

Fixed subject and turned this into an enhancement.


Reported by @atifaziz on 2007-08-02 22:49:04

  • Labels added: Type-Enhancement
  • Labels removed: Type-Defect

@atifaziz
Copy link
Member Author

Reported by @atifaziz on 2007-10-30 21:22:30

  • Status changed: Accepted
  • Labels added: Component-Logic

@atifaziz
Copy link
Member Author

This is now possible via the new ErrorSignal class. See:
http://elmah.googlecode.com/svn/trunk/src/Elmah/ErrorSignal.cs

Calling ErrorSignal.Raise will go through the same set of events as when an unhandled exception is encountered. In effect, you'll get logging plus mailing (even filtering) if that's what's configured. As a result, this issue is being considered fixed for now. If there are issues with ErrorSignal, these should be reported as new issues.


Reported by @atifaziz on 2007-10-30 21:26:23

  • Status changed: Fixed

@atifaziz
Copy link
Member Author

Reported by @atifaziz on 2012-09-13 15:51:44

  • Status changed: New

@atifaziz
Copy link
Member Author

Hmm... Only problem with using ErrorSignal.Raise is it expects an exception, whereas ErrorLog.Log excepts a type of Elmah.Error. If you wanted to create an elmah entry using an Elmah.Error type how would you do this (and send email) without throwing an exception? Or can an exception be easily created using all elmah.error properties?


Reported by Kritner on 2015-01-21 16:51:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant