views:

15

answers:

0

On my ASP.NET 4.0 MVC project running in IIS 7 I have set up and configured ELMAH to log errors on my site. However, I am unable to get any reporting on errors with code 500.

I set up a simple controller that creates a divide-by-zero exception, but ELMAH does not log it. I can get ELMAH to log other messages just fine and I am not filtering out any exceptions in ErrorLog_Filtering.

In addition, to display the custom pages I have updated the httpErrors section of the web.config as follows:

<customErrors mode="RemoteOnly" defaultRedirect="~/error/GenericError">
  <error statusCode="403" redirect="~/error/AccessDenied" />
  <error statusCode="404" redirect="~/error/NotFound" />
  <error statusCode="500" redirect="~/error/Offline" />
  <error statusCode="501" redirect="~/error/Offline" />
  <error statusCode="503" redirect="~/error/Offline" />
</customErrors>

and

<system.webServer>
    <httpErrors errorMode="DetailedLocalOnly" >
        <error statusCode="403" prefixLanguageFilePath="" path="/error/AccessDenied" responseMode="ExecuteURL" />
        <error statusCode="404" prefixLanguageFilePath="" path="/error/NotFound" responseMode="ExecuteURL" />
        <error statusCode="500" prefixLanguageFilePath="" path="/error/GenericError" responseMode="ExecuteURL" />
        <error statusCode="501" prefixLanguageFilePath="" path="/error/GenericError" responseMode="ExecuteURL" />
        <error statusCode="503" prefixLanguageFilePath="" path="/error/Offline" responseMode="ExecuteURL" />

Finally, when reviewing the Application Log files, the code 500 error messages do not show there.

Is there a configuration I am missing or am I somehow accidentally trapping the error myself and not letting it propagate up?