ASP.NET MVC Global Error Handling with ELMAH - best practices

允我心安 提交于 2019-12-06 16:39:22

1) Elmah does do any redirects, so you have handle error pages yourself in web.config (hot ot do this you can look here)

2) You should. Elmah is for logging unhandled exceptions. You can log handled exceptions like this:

try
{
    .....
}
catch(Exception ex) 
{
     Elmah.ErrorSignal.FromCurrentContext().Raise(ex); 
}

3) There is a nice article is on Scott Hanselman blog: ELMAH: Error Logging Modules and Handlers for ASP.NET (and MVC too!)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!