如何设置/配置上ELMAH GoDaddy的ASP.NET主机 [英] How do I setup / configure ELMAH on GoDaddy ASP.NET hosting
问题描述
的供参考:ELMAH是异常日志框架是在这里编码恐怖提到。的
我如何设置/上GoDaddy的ASP.NET主机配置ELMAH?我似乎得到404错误试图访问elmah.axd时。我按照此处所有的说明修改我的web.config和bin部署ELMAH组装。
How do I setup / configure ELMAH on GoDaddy ASP.NET hosting? I seem to get 404 errors when trying to access elmah.axd. I have followed all of the instructions here to modify my web.config and bin deploy the Elmah assembly.
我用下面列出的BETA 2进制下载:的http:// code.google.com / p / ELMAH /下载/列表
I was using the BETA 2 binary download listed here: http://code.google.com/p/elmah/downloads/list
推荐答案
啊哈! 我知道了现在的工作,然后我想分享我所做的起床和运行(它不是完全明显)。
Ah ha! I've got it working now, and I wanted to share what I did to get up and running (it's not entirely obvious).
- 首先,获取最新发布
ELMAH这里:
HTTP://$c$c.google.com/p/elmah/ (一世
结束了使用的释放BETA3
今天刚刚发布,
顺便。道具的ELMAH
开发者。我抓起下载了
该ELMAH-1.0-BETA3彬下降。 - 解压缩到一个位置上你
磁盘 - 查找在
ELMAH-1.0-BETA3斌\\样本
目录中的web.config和开放
这在编辑器中。 (有很多
在这个文件中的HTML注释
解释不同的条目 -
颜色编码的IDE /编辑器是非常
这里很有用。) - 的部分(约的方式3/4
下来了开头的配置)
部分是
需要下运行ELMAH
Internet信息服务7.0'的是非常
重要的。这是在配置
部分中,您将使用。
GoDaddy的使用IIS 7.0的.NET 2.X / 3.X ASP.NET主机,让您使用system.webServer部分,而不是system.web节是很重要的。
GoDaddy uses IIS 7.0 for its .NET 2.x/3.x ASP.NET hosting, so it's important that you use the system.webServer section, not the system.web section.
我用下面的配置部分,并将它们添加到我的web.config适当的地方:
I have used the following config sections and added them to the appropriate places in my web.config:
<configSections>
<sectionGroup name="elmah">
<!-- NOTE! If you are using ASP.NET 1.x then remove the
requirePermission="false" attribute from the section
elements below as those are only needed for
partially trusted applications in ASP.NET 2.0 -->
<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" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="true" />
<!--
Use to log errors into separate XML files that are stored on
disk at the path specified in the logPath attribute.
-->
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="Elmah.ErrorFilter" type="Elmah.ErrorFilterModule" preCondition="managedHandler" />
<add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
最后请注意:*如果您使用基于XML的日志记录(比如我),请确保在的App_Data STRONG>目录存在了你的根Web目录*
One final note: *If you're using xml based logging (like I am) make sure the App_Data directory exists off your root web directory.*
这种配置的最终结果是,我可以使用ELMAH来查看发生在PROD(由ELMAH记录)异常,但因为我不能在本地ASP.NET开发服务器使用ELMAH。我觉得这是一个很好的权衡,因为我可以在Visual Studio中看到本地例外。
The end result of this configuration is that I can use ELMAH to view exceptions that occur in prod (and are logged by ELMAH), but since I can't use ELMAH in the local ASP.NET development server. I think this is a good trade-off since I can see exceptions locally in Visual Studio.
*更新08年12月9日 - 出于某种原因,我一直无法弄清楚如何写* .xml文件来APP_DATA,所以我切换到SQL记录器。只是一定要运行在你的数据库,你的配置脚本.SQL *
*Update 12/9/08 - For some reason, I haven't been able to figure out how to write *.xml files to app_data, so I switched to the SQL logger. Just be sure to run the .sql script in your database that you configure.*
这篇关于如何设置/配置上ELMAH GoDaddy的ASP.NET主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!