是否可以在SharePoint环境中使用ELMAH?

是否可以在SharePoint环境中使用ELMAH?,sharepoint,moss,elmah,Sharepoint,Moss,Elmah,是否有人已集成到其SharePoint环境中 我想这是可能的,因为它都是ASP.net,但我只是想知道是否有人这样做过,是否有一个关于如何实现它的演练?它没有魔力,只需像在任何其他ASP.net网站上一样连接它。我们在MOSS 2007环境中使用ELMAH。由于ELMAH使用HttpHandlers并通过web.config进行设置,因此激活它是轻而易举的。只需将ELMAH内容添加到您在SharePoint中运行的应用程序的web.config中 如果希望ELMAH以高于自定义应用程序的级别报告

是否有人已集成到其SharePoint环境中


我想这是可能的,因为它都是ASP.net,但我只是想知道是否有人这样做过,是否有一个关于如何实现它的演练?

它没有魔力,只需像在任何其他ASP.net网站上一样连接它。

我们在MOSS 2007环境中使用ELMAH。由于ELMAH使用HttpHandlers并通过web.config进行设置,因此激活它是轻而易举的。只需将ELMAH内容添加到您在SharePoint中运行的应用程序的web.config中


如果希望ELMAH以高于自定义应用程序的级别报告错误,请将其添加到SharePoint web.config。

在设置ELMAH或SharePoint中的大多数HttpModule时,一件很重要的事情是它们必须位于HttpModule部分的开头。否则,SharePoint将基本上吞并该异常,并且不会调用ELMAH功能

有效

<clear />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>  
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
<add name="SPRequest" type="Microsoft.SharePoint.ApplicationRuntime.SPRequestModule, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     ... Rest of SharePoint modules....

... SharePoint模块的其余部分。。。。
不起作用

<clear />
<add name="SPRequest" type="Microsoft.SharePoint.ApplicationRuntime.SPRequestModule, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     ... Rest of SharePoint modules....
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>  
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>

... SharePoint模块的其余部分。。。。

以下是需要添加到SharePoint web应用程序的web.config中的配置项

在configsection下添加

 <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>

添加connectionstring部分

<connectionStrings>
 <add name="elmah-express" connectionString="Data Source=[server name];Initial Catalog=  [ELMAH_customlogging];User ID=testuser;Password=Welcome1;" />

</connectionStrings>


好东西!谢谢所以,如果你自己没有在代码中捕捉到异常,它将沿着管道向上移动,直到ELMAH捕捉到并记录它?是的,这正是发生的情况。您还可以在ELMAH中记录已处理的异常。您在哪里部署了dll?我想部署到GAC,覆盖我们所有的网站。
<elmah>

  <security allowRemoteAccess="0" />

  <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="elmah-express" />
</elmah>
  <httpHandlers>

      <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>

   </httpHandlers>

   <httpModules>

      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
    </httpModules>
    <modules runAllManagedModulesForAllRequests="true">

    <remove name="ErrorLog"/>

     <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>