Elmah not working on IIS7 server

不羁岁月 提交于 2019-11-30 04:12:40

问题


I have Elmah running on my MVC 3 site, and have everything working on my local development machine.

However, now that I've moved my site to my production server, Elmah is not working. I am using the same SQL account (and connection string) on my live server as I'm using on my local machine. The EF4 connection (same as Elmah) works just fine.

I don't see anything in the Even Logs or in SQL Profiler. I don't see any errors in the SQL logs either.

Any ideas on what could be happening, or how I could troubleshoot this?

Thanks in advance.


回答1:


ELMAH is using a HttpModule to log errors. For IIS6, HttpModules are registered under System.Web in the web.config file. However, for IIS7+, HttpModules should be registered under the system.webserver namespace. The embedded development web server will use the IIS6 config.

IIS6:

  <system.web>
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    </httpModules>
  </system.web>

IIS7:

  <system.webServer>
    <modules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    </modules>
  </system.webServer>


来源:https://stackoverflow.com/questions/5387652/elmah-not-working-on-iis7-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!