Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

jamiehumphries/Elmah.SqlServer.EFInitializer

Repository files navigation

Elmah.SqlServer.EFInitializer

Build status

Automatically creates an Elmah database on SQL Server using Entity Framework migrations.

Installation

This project is available as a NuGet package. It can be installed from the Visual Studio Package Manager Console using Install-Package Elmah.SqlServer.EFInitializer.

Configuration

By default the database will be created using the DefaultConnection connection string.

If you wish to use a different connection string, you should declare a named string in the connectionStrings section of Web.config and edit the connectionStringName attribute on the elmah / errorLog configuration element. For example:

<configuration>
  <!-- Other configuration omitted -->
  <connectionStrings>
    <add name="ElmahConnection"
         connectionString="Data Source=(local);Initial Catalog=Elmah;Integrated Security=True;"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
  <elmah>
    <errorLog type="Elmah.SqlErrorLog, Elmah" 
              connectionStringName="ElmahConnection" />
  </elmah>
</configuration>

Usage note

The intent of this package is only to automate the creation of a backing SQL Server database for Elmah and provide enough configuration to do the basic logging. Errors will be logged to the database, but you will also need to install something like the main Elmah package or Elmah.MVC to view them within the site.

Acknowledgements

Credit must go to the creators of Elmah.SqlServer, the SQL from that project is what I used for the migrations.

About

Automatically creates an Elmah database on SQL Server using Entity Framework migrations.

Resources

License

Stars

Watchers

Forks