什么web.config中的一部分,我该插入ELMAH标签? [英] what part of web.config do i insert the elmah tag?

查看:114
本文介绍了什么web.config中的一部分,我该插入ELMAH标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写这个

<elmah>
    <errorlog type="Elmah.XmlFilerErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

<elmah>
  <errorLog type="Elmah.SQLiteErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

但是每到一个地方我试图把这个标签在我得到一个无法识别的配置节ELMAH。错误。我发现这个问题,<一个href=\"http://stackoverflow.com/questions/1337316/configuring-elmah-unrecognized-config-section-error\">http://stackoverflow.com/questions/1337316/configuring-elmah-unrecognized-config-section-error但是我想,(在这个问题的解决方案,底部),并仍然得到错误。我在哪里可以把这个?

however every place i tried putting this tag in i get an Unrecognized configuration section elmah. error. I found this question http://stackoverflow.com/questions/1337316/configuring-elmah-unrecognized-config-section-error however i tried that (solution at the bottom of the question) and still get the error. Where do i put this?

-edit-我发现这个问题。我没有设定&LT; sectionGroup NAME =ELMAH&GT; 正常。我不能在网上找到才想起演示了sqlite的记录和我查的线索演示配置。

-edit- i found the issue. I didnt set <sectionGroup name="elmah"> properly. I couldnt find it online then remembered the demo had sqlite logging and i checked the demo config for clues.

推荐答案

您需要添加栏目组。事情是这样的:

You need to add the section group. Something like this:

<sectionGroup name="elmah">
  <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
</sectionGroup>

然后,你可以在任何地方添加ELMAH部分的配置标签(而不是其他任何标签内)内。

Then you can add the elmah section anywhere inside the "configuration" tag (not inside any other tag).

这篇关于什么web.config中的一部分,我该插入ELMAH标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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