//Global.asax
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Error(object sender, EventArgs e)
{
Exception exception = Server.GetLastError();
if (exception != null)
{
//log the error
}
}
protected void Application_Start()
{
//may have some MVC registration stuff here or other code
}
}