ELMAH.axd is viewable, but will never log any of my errors?

I have all the settings, and I can go to /elmah.axd, but I cause all these errors and it will not log any of them, it just says "errors are not logged" ... what the hell did I do wrong ?

Here is the stuff I added to my web.config:

<configSections> <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /> <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /> <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" /> </sectionGroup> </configSections> <httpHandlers> <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> </httpHandlers> <httpModules> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /> </httpModules> <elmah> <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" /> <security allowRemoteAccess="yes" /> </elmah> 

ALSO: That was already at the beginning of my RegisterRoutes ()

 routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

I read that this doesn't make any difference with ASP.NET MVC 1.0, though, presumably (on the ELMAH site ...)

+4
source share
2 answers

The configuration seems to be in order; my best guess is that the user of your IIS web application is not allowed to write to App_Data. If you have blocked access rights, the application user will read, but not write, the permissions there.

You can open permissions or go to another directory outside the web path (which is a safer IMO) and make sure that it has read / write permissions.

+4
source

Recipe for solution

I installed elmah and elmah on XML log from nuget, did not get the expected functionality, although I could access http://localhost/elmah.axd , but could not capture the error.

I gave permission to write to the IIS_IUSERS account in the APP_DATA folder and started working for HTTP 404 errors and errors that are outside the MVC infrastructure. But he did not register exceptions inside mvc. The solution was to install the elmah.mvc package from nuget, and it began to catch all exceptions.

If your configuration is ok, then just install the elmah.mvc package from nuget and it should start storing logs inside mvc too, not just HTTP 404.

+4
source

All Articles