Two days ago found an open source log component Elmah, I like it all of a sudden, like him because it supports "hot plug" (no need to change any program), a simple configuration (several lines of configuration), a variety of logging methods (database, file, Email), supporting multiple databases (Access, SQL Server, Oracle, Sqlite, vistadb), and view results do not need to be written (and support RSS publishing view).
Elmah the latest version is ELMAH-1.0-BETA3, he is based on httpmodules, httphandlers processing, but only log the error log does not deal with, but this is enough, we are likely to occur in the unusual place will be handled, For unexpected exceptions to the elmah on it, we just give users a friendly error page can be.
His usage is very simple, simple to believe, the following details of his usage.
The newest component of download component Click here to download elmah-1.0-beta3, add the bin file add Elmah.dll to the project (he supports net-1.0, 1.1, 2.0, 3.5).
Second, the DB folder under the SQL script execution, we choose Sqlserver.sql here, in your database will generate a elmah_error table.
Third, configure Webconfig to add in <configuration>:
<configSections>
<sectiongroup name= "Elmah" >
<!--tips! asp.net1.x requirepermission= "false" to remove-->
<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.E Rrormailsectionhandler, Elmah "/> <section name=" Errorfilter "requirepermission="
false "Type=" Elmah.Error Filtersectionhandler, Elmah "/>
</sectionGroup>
</configSections>
<elmah >
<security allowremoteaccess= "0"/><!--whether remote access is allowed. 0 represents no, 1 representatives are-->
<errorlog type= "Elmah.xmlfileerrorlog, Elmah" logpath= "E:\LogHaHa\"/><!--recorded to file- >
</elmah>