Navigate to Post

Friday, April 10, 2020

Integrate ELMAH, Asp.Net site and MySql


ELMAH enables logging of all unhandled exceptions. ELMAH logs all errors in many storages, like - SQL Server, MySQL, Randon Access Memory (RAM), SQL Lite, and Oracle.

Here we will see how we can integrate elmah into our asp.net site and we are using MySql storage to log error.

ADDING PACKAGE

Here we need to add NuGet package "elmah"





RUN SCRIPT


Run script on your MySql database, get Script from here


MODIFY WEB.CONFIG

Go to web.config and modify elmah configuration to

<elmah>
    <errorLog type="Elmah.MySqlErrorLog, Elmah" connectionStringName="YourConnectionStringName"/>
    <security allowRemoteAccess="true" />
  </elmah>

RUN PROJECT

Run site and hit "http://localhost:XXX/elmah.axd" we can see unhandled error rased in the site. 





All time trending post