ELMAH不记录404(丢失的文件/图片) [英] Elmah not logging 404 (missing files / images)

查看:200
本文介绍了ELMAH不记录404(丢失的文件/图片)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因emlah是不是在我MVC3应用程序日志丢失的图像。其他的都是像失踪行动错误的URL就可以了。可能是什么原因?
谢谢

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

编辑:

我运行的集成模式,我不使用内置的VS IIS。

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


编辑2:

似乎没有登录如果图像是通过虚拟目录映射图像丢失:

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

推荐答案

那是因为你没有在IIS集成的管线模式下运行。如果要测试这个Visual Studio的内置Web服务器(卡西尼)内或IIS 6.0或者IIS 7.0经典模式,图像是由Web服务器,而不是通过ASP.NET环境直接服务。如此以来,ELMAH是一个ASP.NET处理程序,它无法了解这些图像的方式。

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.

您可以切换到使用当地IIS防爆preSS,当你船的应用IIS 7.0集成的管线模式。然后你会得到日志未找到静态资源,如图片。

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.

这篇关于ELMAH不记录404(丢失的文件/图片)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆