简体   繁体   中英

Elmah not working on IIS7 server

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM