ELMAH-1.0-BETA3,引用 Elmah.dll(支援 .NET 1.0~3.5)。SQLServer.sql),建立 ELMAH_Error 資料表。Web.config:<configSections>
<sectionGroup name="elmah">
<section name="security" type="Elmah.SecuritySectionHandler, Elmah" requirePermission="false" />
<section name="errorLog" type="Elmah.ErrorLogSectionHandler, Elmah" requirePermission="false" />
<section name="errorMail" type="Elmah.ErrorMailSectionHandler, Elmah" requirePermission="false" />
<section name="errorFilter" type="Elmah.ErrorFilterSectionHandler, Elmah" requirePermission="false" />
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="0" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="E:\LogHaHa\" />
</elmah>
以上配置將錯誤以 XML 檔案形式儲存於 E:\LogHaHa\,禁止遠端存取。若需資料庫記錄,將 errorLog type 改為 Elmah.SqlErrorLog 並設定連線字串即可。