ELMAH (Error Logging Modules and Handlers for ASP. NET) is an ASP. NET, which can easily record asp.net errors to XML, MS SQLServer, SQLite, MySql and other files, and even it can send mail.
Http://code.google.com/p/elmah/
This is an open-source component that allows you to easily report Global website errors.
On the <configSections> node, add
<SectionGroup name = "elmah"> <section name = "security" type = "Elmah. securitySectionHandler, Elmah "/> <section name =" errorLog "type =" Elmah. errorLogSectionHandler, Elmah "/> <section name =" errorMail "type =" Elmah. errorMailSectionHandler, Elmah "/> <section name =" errorFilter "type =" Elmah. errorFilterSectionHandler, Elmah "/> </sectionGroup>
Add
<Elmah>
<! -- Whether remote access is allowed. 0 indicates no, 1 indicates yes -->
<Security allowremoteaccess = "1"/>
<Errormail
From = "test@test.com" is the mailbox for sending
To = "huangyuan413026@163.com, 364965519@qq.com" is sent to both mailboxes
Subject = "system error..." title
Async = "true" // asynchronous
Smtpport = "25"
Smtpserver = "mail.test.com"
Username = "test@test.com"
Password = "*****"
Noysod = "True | false" // whether the email contains attachments
/>
Website/app_data/Access Database
<Errorlog type = "elmah. accesserrorlog, elmah" connectionstring = "provider = Microsoft. Jet. oledb.4.0; Data Source = | datadirectory | elmah. mdb"/> </elmah>
Add under httphandlers Node
Access Huangyuan. axd to see the error message.
<Add verb = "post, get, head" Path = "Huangyuan. axd" type = "elmah. errorlogpagefactory, elmah"/>
Add under httpmodules Node
<Add name = "errorlog" type = "elmah. errorlogmodule, elmah"/>
<Add name = "errormail" type = "elmah. errormailmodule, elmah"/>
Add access permission
<Location Path = "elmah. axd">
<System. Web>
<Authorization>
<Deny users = "? "/>
</Authorization>
</System. web>
</Location>
If the website server is Window2003, you must have the write permission on the path (IIs_wpg)