Search code examples
c#sql-serverwebformselmah

Elmah not logging errors after server rebuild


Our data center got a virus a couple days ago. The database server had to be rebuilt completely. Fortunately, we recovered all of our databases. The Elmah database is, however, empty for some reason. The code (C# .NET) hasn't changed either. (So, we are logging the errors to a SQL Database.)

However, the system is not logging errors any longer. I removed the database user and re-added it, added some permissions back in, and now we can see the .axd page with the list of errors now, even though there aren't any.

So, I'm thinking this just has to be a connection issue or something. However, I don't really have any error page to show or anything. Nothing should have changed structurally.

Any ideas on what this could be or how I could get it to show me what isn't working?

From what I understand, when the system encounters an error, it calls the Application_Error method in Global.asax.cs. That code is pretty generic.

I should note that we may be on a very old version of Elmah. The dll has a date modified of 4/12/2012. Version 1.2.14706.955


Solution

  • Sounds like you are missing some parts of ELMAH in the database. Could be the stored procedure. Maybe run the installation script (https://github.com/elmah/SqlErrorLog/blob/master/src/SQLServer.sql) again.