I wish to send mail to an administrator when the application crashes.
So I simply do this in global.asax
:
void Application_error(object sender, EventArgs e)
{
SendMessageToAdministarator(Server.GetLastError().ToString());
}
But actually many times Application_Error
is called even though the application won't crash.
And I wish to send mail to admin ONLY when the application crashed.
Also, do I have a simple way to lift the application back on?
I'm looking for the simplest solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…