Elmah 不在现场工作
我将 elmah 与 asp.net mvc 3 站点一起使用,它在本地工作正常,但是当我将其上传到我的共享托管站点(iis 7)时,它似乎没有记录任何错误。
我使用 nuget 来获取该库,并且假设它在 web.config 中设置了它需要的所有内容。
所以我不知道我错过了什么以及为什么它没有出现。
编辑
这里是我拥有的一切
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<elmah xdt:Transform="Replace">
<errorMail from=""
to=""
cc=""
subject=""
async="true"
smtpPort="26"
smtpServer=""
userName=""
password="" />
<errorLog type="Elmah.SqlErrorLog, Elmah" logPath="~/App_Data" connectionStringName="ConnectionString" />
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="404" type="Int32" />
</test>
</errorFilter>
<security allowRemoteAccess="0" />
</elmah>
</configuration>
<system.web>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
I am using elmah with an asp.net mvc 3 site and it works fine locally but when I upload it to my shared hosting site(iis 7) it does not seem to log any of the errors.
I used nuget to grab the library and I was under the assumption that it set up all the stuff in the web.config that it needs.
So I have no clue what I am missing and why it does not show up.
Edit
here is everything elmah I have
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<elmah xdt:Transform="Replace">
<errorMail from=""
to=""
cc=""
subject=""
async="true"
smtpPort="26"
smtpServer=""
userName=""
password="" />
<errorLog type="Elmah.SqlErrorLog, Elmah" logPath="~/App_Data" connectionStringName="ConnectionString" />
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="404" type="Int32" />
</test>
</errorFilter>
<security allowRemoteAccess="0" />
</elmah>
</configuration>
<system.web>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 NuGet 下载了它,您应该准备好所有配置部分。
无论如何,请尝试检查您的
system.webServer
部分:if you have downloaded it with NuGet you should have all the config sections ready.
Anyway, Try and check your
system.webServer
section: