1.2 ELMAH不会记录到SQL在Windows 2008 IIS7.5集成模式(但本地工作) [英] Elmah 1.2 does not log to SQL on Windows 2008 IIS7.5 Integrated mode (but works locally)
问题描述
我要建一个新的Web窗体ASPNET 4.0网站和使用的NuGet安装ELMAH 1.2。我添加了一个行到web.config登录到SQL Server EX preSS,并建立相关的表和存储3特效。本地(Win 7的/ IIS 7.5)一切正常时(通过VS2010开发服务器上运行,而我的本地IIS) - 我打elmah.axd /测试然后返回elmah.axd,果然,我的错误已被记录。
I'm building a new Web Forms aspnet 4.0 website and have installed Elmah 1.2 using NuGet. I've added a line to the web.config to log to sql server express, and created the relevant table and 3 stored procs. Locally (Win 7/ IIS 7.5) everything works well (when run through vs2010 dev server, and my local IIS)- I can hit elmah.axd/test then return to elmah.axd and, sure enough, my error has been logged.
我然后发布该网站达到我们的开发服务器(赢2008 R2 / IIS 7.5)。如果我打elmah.axd它告诉我有没有错误 - 然后我去elmah.axd /测试,并返回到ELMAH,仍然没有错误。如果我切换记录成为记忆,而不是SQL一切工作正常。
I then publish the site up to our dev server (Win 2008 R2/ IIS 7.5). If I hit elmah.axd it informs me there are no errors- I then go to elmah.axd/test and return to Elmah, and still no errors. If I switch the logging to be to memory instead of SQL everything works fine.
我添加了执行站点中的所有存储的特效权限的应用程序池的用户。我甚至创建了一个名为ElmahConnString一个单独的连接字符串,如SA-登录仍然没有运气。 (我试过从SA删除一个,以确保它打破了,果然它broke-所以这肯定是使用康恩字符串)。
I have added execute rights to the app pool user for all stored procs in the site. I even created a separate connection string called ElmahConnString, logging in as SA- still no luck. (I tried deleting the a from sa to ensure it broke, and sure enough it broke- so it was definitely using that conn string).
我的web配置看起来像这样(大部分这是把我的NuGet!);
My web config looks like this (most of this was put in my NuGet!);
<configuration>
<configSections>
<sectionGroup name="elmah">
<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>
...
<connectionStrings>
<add name="ConnString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=SiteData;Integrated Security=True" />
</connectionStrings>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ConnString" />
<security allowRemoteAccess="yes" requirePermission="false"/>
</elmah>
...
<system.web>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
...
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
您会注意到这个包括这个问题,就是在底部的system.webserver块最widly给出的答案:(
You'll notice this encompasses the most widly given answer for this problem which is that system.webserver chunk at the bottom :'(
我不明白这一点?我缺少什么?
I don't get it? What am I missing?
推荐答案
您不能插入到数据库中,但它不是一个sql权限问题?
You can't insert into the database but it's not a sql permissions problem?
- 也许你的磁盘已满。
- 也许你已经创建了一个表没有IDENTITY列,其中应该有一个。
说真的 - 你不能等待两分钟之一个答案?也许这是插入到数据库中,但你检查太快。
Seriously - you couldn't wait two WHOLE MINUTES for an answer? Maybe it is inserting into the database, but you're checking too quickly.
这篇关于1.2 ELMAH不会记录到SQL在Windows 2008 IIS7.5集成模式(但本地工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!