Elmah not logging 404 (missing files / images)

与世无争的帅哥 提交于 2019-12-11 02:25:18

问题


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.

EDIT 2:

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


回答1:


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.



来源:https://stackoverflow.com/questions/8892233/elmah-not-logging-404-missing-files-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!