Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 610
Jerad Rose Avatar asked Mar 22 '11 06:03

Jerad Rose


1 Answers

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>
like image 166
DEHAAS Avatar answered Oct 20 '22 00:10

DEHAAS