Reputation: 55729
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to the windows event log. The other doesn't.
Is there a setting in IIS or the web.config to enable event log logging?
Apologies for the broad question, I'm really looking for avenues for investigation.
Upvotes: 5
Views: 7932
Reputation: 55729
Turning CustomErrors on started stuff being added to error log.
Final solution was to add
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
to the
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
...
Section of the web.config. This enabled Elmah in IIS7.
Loose understanding - exceptions were being intercepted by elmah, which was mal-configured for the above reason, causing swallowing of errors. Turning custom errors on, seemed to bypass elmah and enable errors to push through to event log.
Upvotes: 0
Reputation: 16342
If the user running the webapp (the IIS user) isn't an admin, make sure that the event source is registered with the OS.
Upvotes: 1
Reputation: 499002
This is normally due to the account running the web application not having the right permissions to write to the event log.
In IIS 7, check the identity the application pool is running under.
Upvotes: 3