jamiehumphries / Elmah.SqlServer.EFInitializer

Automatically creates an Elmah database on SQL Server using Entity Framework migrations.
http://jamiehumphries.github.io/Elmah.SqlServer.EFInitializer/
MIT License
4 stars 6 forks source link

Connection string is now dynamically loaded from elmah configuration #1

Closed theyo closed 10 years ago

theyo commented 10 years ago

I need to log the elmah errors to the same database my application uses, I found that I would have to duplicate my already existing connection string, or rename mine to ElmahConnection, in order for the migrations to work.

I thought about simply modifying the ElmahContext.Initialize() method to take a connection string, but I noticed that you recently took that out. As I gave it more thought, I realized that we already have everything we need because the elmah/errorLog config section lets us specify a connection string. Reading the already dynamic config value gives us the flexibility to use a separate database for our elmah logs, or use an already existing connection with no duplication of configuration information.

jamiehumphries commented 10 years ago

Thanks for this! I'll merge it in, maybe make a few minor tweaks and re-release the package.