seguito sono le voci di configurazione che devono aggiunto web.config dell'applicazione web di SharePoint
Aggiungi sotto 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>
Aggiungere connectionString sezione
<connectionStrings>
<add name="elmah-express" connectionString="Data Source=[server name];Initial Catalog= [ELMAH_customlogging];User ID=testuser;Password=Welcome1;" />
</connectionStrings>
Aggiungi ELMAH sezione appena sotto la sezione connectionstring
<elmah>
<security allowRemoteAccess="0" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="elmah-express" />
</elmah>
Aggiungi conduttore e voce del modulo in httpHandlers e httpModules sezione in system.web
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
</httpModules>
Aggiungere conduttore e voce del modulo nei gestori e moduli di sezione in 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>
prega di fare riferimento al di sotto di collegamento per l'attuazione ELMAH in SharePoint
http://sidteche.blogspot.in/2014/08/implement-elmah-custom-logging-in.html
roba eccellente! Grazie. Quindi se non prendi tu stesso un'eccezione nel codice, si muoverà sulla pipeline fino a che ELMAH non lo catturerà e lo registrerà? – Rob
Sì, è esattamente quello che succede. Puoi anche registrare le eccezioni gestite in ELMAH. –
Dove hai distribuito la tua dll? Mi piacerebbe distribuire al GAC per coprire tutti i nostri siti web. – Rob