ShaneKm
ShaneKm

Reputation: 21328

Elmah not logging 404 (missing files / images)

For some reason emlah is not logging missing images in my MVC3 app. Everything else like 'missing action' wrong url is ok. what could be the cause? thanks

EDIT:

I am running Integrated Mode and am NOT using built-in VS IIS.

enter image description here enter image description here

enter image description here

EDIT 2:

Doesn't seem to log missing images if the images are mapped via virtual directory: enter image description here

Upvotes: 2

Views: 1156

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038730

That's because you are not running in IIS integrated pipeline mode. If you are testing this inside the Visual Studio's built-in web server (Cassini) or IIS 6.0 or IIS 7.0 classic mode, images are served directly by the web server and not through the ASP.NET environment. So since, ELMAH is an ASP.NET handler, it has no way of knowing about those images.

You could switch to using IIS Express locally and when you ship use IIS 7.0 integrated pipeline mode. Then you will get logs for not found static resources such as images.

Upvotes: 3

Related Questions