public class corHandleErrors:umbraco.Global { public corHandleErrors() {
}
protected override void Application_Error(object sender, EventArgs e) { //Email Web Admin and get the referrer string referringPage = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_REFERER"]; Exception ex = Server.GetLastError(); Log.Add(LogTypes.Custom, -1,String.Format("StackTrace is: {0} | Inner Exception is: {1}", ex.StackTrace, ex.InnerException));
SmtpClient oClient = new SmtpClient(); MailMessage message = new MailMessage();
Inheriting from umbraco.Global and System.Web.HttpApplication works I just forgot to add the global.asax to the root of my web application. DANG. As soon as I added that I received the Logs and Emails as expected.
Hooking into Global.asax in UMB 4.5.2
All,
I've read Ismail's and Matt's blogs and I still cannot get this to work.
http://blog.mattbrailsford.com/2010/07/11/registering-an-application-start-event-handler-in-umbraco/
http://ismailmayat.wordpress.com/2009/05/19/integrating-log4net-into-umbraco-site/
Here's the code:
I've removed the App_global.asax.dll. Am I missing something?
Kevon,
Don't inherit from umbraco.global inherit from System.Web.HttpApplication
Regards
Ismail
I'll give it a try and let you know.
Inheriting from umbraco.Global and System.Web.HttpApplication works I just forgot to add the global.asax to the root of my web application. DANG. As soon as I added that I received the Logs and Emails as expected.
is working on a reply...