Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make ELMAH log to MySQL?

We have integrated ELMAH with ASP.NET MVC 3, as a way to log application errors. However, we do not yet persist the log. To this end, we'd like to store ELMAH's log entries in MySQL, as we're already using an instance of this database server for other purposes.

How do we configure ELMAH so that it persists its log with MySQL?

like image 573
aknuds1 Avatar asked Jan 05 '12 10:01

aknuds1


1 Answers

You can install the NuGet package ELMAH on MySQL

PM> Install-Package elmah.mysql

You have to configure that. from Elmah.MySql.txt which is part of the package.

Please note that in order to complete the installation of ELMAH.MySql you will have to do the following:

  1. Make sure you have the latest MySQL Connector installed from http://dev.mysql.com/downloads/connector/net/ (this is optional, since we already include MySql.Data.dll, if you download the latest connector you don't need our version)
  2. Run the Elmah.MySql.sql script against your database
  3. Edit your web.config with the correct settings in the elmah to connect to your database

More Information

  • ELMAH on MySQL (requires manual config) 1.2
like image 104
dknaack Avatar answered Sep 19 '22 07:09

dknaack