Elmah在我的本地网络个人网络服务器上运行得非常好。但是,即使我连接到同一SQL服务器,它也不会将任何错误记录到生产服务器上的同一SQL Server。当我访问elmah.axd时,它显示页面正常但没有记录错误。非常感谢任何帮助。
Web.Config文件
<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>
</configSections>
<appSettings>
<add key="myAdvanceApp" value="myAdvanceApp"/>
</appSettings>
<connectionStrings>
<add name="advanceConnStr" connectionString="Data Source=gans;Initial Catalog=Advancement;Persist Security Info=True;User ID=myUser;Password=myPass" providerName="System.Data.SqlClient"/>
<add name="myADConnString" connectionString="LDAP://myDomain.com/ou=useraccounts,DC=myDomain,DC=com"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<httpRuntime maxRequestLength="32768" />
<!--<authentication mode="Windows"/>-->
<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="30" loginUrl="Admin/Login.aspx" />
</authentication>
<membership defaultProvider="myApp">
<providers>
<add name="myADProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionUsername="myDomain-mail\mybldap" connectionPassword="mypassword)" connectionStringName="myADConnString" attributeMapUsername="sAMAccountName" />
</providers>
</membership>
<!--<customErrors mode="Off" />-->
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
<add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagPrefix="cc1"/>
</controls>
</pages>
</system.web>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="advanceConnStr" applicationName="myAdvanceApp" />
<security allowRemoteAccess="true" />
</elmah>
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
<location path="elmah.axd">
<system.web>
<authorization>
<allow users="myUserName" />
<deny users="*,?" />
</authorization>
</system.web>
</location>
</configuration>