7

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.

Jerad Rose
  • 15,235
  • 18
  • 82
  • 153

1 Answers1

18

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>
Kasper Holdum
  • 12,993
  • 6
  • 45
  • 74
DEHAAS
  • 1,294
  • 11
  • 17
  • Perfect, this was the problem. I couldn't find this anywhere, thank you for your help! – Jerad Rose Mar 22 '11 at 13:37
  • 2
    Great answer :) Fixed my problem too. Just a side note I wish to add in case you also want to see the error log page "elmah.axd". You also have to register the httpModule that handles elmah.axd under instead of under because of the new iis 7 integrated mode. In Integrated mode, ASP.NET handler mappings must be specified in the unified /. See http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis-7/ – Liviu Trifoi Jul 10 '11 at 10:29