1
我的理解的工作是提高一个errorsignal应登录我的错误或打自定义HandleErrorWithELMAHAttribute类(从这个example拍摄),但它既不。错误信号不与ASP.NET MVC
我对控制器使用HandleErrorWithElmah装饰器。错误日志记录在控制器中处理未处理的异常(我明确调用Logexception并且未使用第二个代码块example中提到的条件)时起作用。但是,用于处理错误的错误信号功能让我感到困惑。如何错误信号工作...它应该做的比其他记录的东西......如果是这样我该如何使用它登录我处理的异常?
这是我使用的信号处理的错误
ErrorSignal.FromCurrentContext().Raise(new Exception("Some Handled Error"));
及以下的web配置的我的设置片段
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Log" />
</elmah>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
</httpModules>
感谢菲尔...这解决了这个问题。看起来我们需要这些标签,当我部署到我正在使用的IIS7。 ELMAH的信号无声无息地让问题变得更加神秘。在这个更详细的解释在这里http://stackoverflow.com/questions/933554/elmah-not-working-with-asp-net-site#answer-1175023发现 – Mulki 2010-09-29 07:07:01