开发者

Elmah not working on live site

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" preConditi开发者_StackOverflow社区on="integratedMode" />
      </handlers>
  </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:

  <system.webServer>
    <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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜