. Net system error logging tool Elmah

Source: Internet
Author: User
Tags website server

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.