我正在尝试设置ELMAH来为我们的应用程序记录错误。我已成功添加模块并且加载 ErrorLog 页面 (elmah.axd) 没有问题。但是,Elmah 没有记录我生成的任何测试异常。
我的 web.config 看起来像这样:
<configSections>
<!-- Other stuff -->
<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"/>
</sectionGroup>
</configSections>
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>
<httpHandlers>
<!-- Other stuff -->
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
</httpHandlers>
<httpModules>
<!-- Other stuff -->
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules>
点击测试异常页面会http://localhost/elmah.axd/test
生成黄屏,但没有日志条目。
在提供的示例和DotNetSlackers上的教程之间,我看不出有任何问题。有什么我想念的吗?我也尝试通过Signaling生成错误,但这也不起作用。
我正在针对 DotNetNuke 运行它,这就是我目前认为问题所在的地方。