10

ELMAHをSharePoint環境に統合した人はいますか?

すべてASP.netなので可能だと思いますが、誰かがそれをやったのか、それを実現する方法についてのウォークスルーがあるのだろうかと思いました。

4

4 に答える 4

9

ELMAH、またはSharepointのほとんどのHTTPModuleを設定するときに重要なことの1つは、httpModulesセクションの先頭にある必要があるということです。そうしないと、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....

動作しません

<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"/>
于 2009-07-28T18:26:52.313 に答える
6

MOSS2007環境ではELMAHを使用しています。ELMAHはHttpHandlersを使用し、web.configを介して設定されるため、それをアクティブ化するのは簡単でした。SharePoint内で実行しているアプリケーションのweb.configにELMAHのものを追加するだけです。

ELMAHでカスタムアプリケーションよりも高いレベルでエラーを報告する場合は、それをSharePointweb.configに追加します。

于 2009-05-06T14:16:56.530 に答える
0

魔法はありません。他のASP.NETサイトと同じように接続するだけです。

于 2009-05-06T14:13:49.847 に答える
0

以下は、SharePointWebアプリケーションの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>

connectionstringセクションのすぐ下にelmahセクションを追加します

<elmah>

  <security allowRemoteAccess="0" />

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

system.webのhttphandlersおよびhttpmodulesセクションにハンドラーとモジュールのエントリを追加します

  <httpHandlers>

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

   </httpHandlers>

   <httpModules>

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

system.webserverの下のハンドラーとモジュールセクションにハンドラーとモジュールエントリを追加します

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

SharePointでのelmahの実装については、以下のリンクを参照してください

http://sidteche.blogspot.in/2014/08/implement-elmah-custom-logging-in.html

于 2014-08-02T19:59:15.807 に答える