自ELMAH 1.0开始使用的直接日志写入方法:
try { some pre }catch(Exception ex){ Elmah.ErrorLog.GetDefault(HttpContext.Current).Log(new Elmah.Error(ex));}ELMAH 1.2引入了更灵活的API:
try { some pre }catch(Exception ex){ Elmah.ErrorSignal.FromCurrentContext().Raise(ex);}两种解决方案之间有区别:
Raise
方法将ELMAH过滤规则应用于异常。Log
方法没有。Raise
基于订阅,并且能够将一个异常记录到多个记录器中。



