Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

Elmah not logging, elmah.axd page is always null when using SqlErrorLog

First make sure that you're web.config file is setup properly and that you have defined elmah to handle the error in each controller. You can do that easily in c# mvc3 by using nuget and downloading elmah, elmah.corelibrary and elmah.contrib.mvc.

 Also double check that you have the ff in your database:
1.) Table: Elmah_Error
2.) SP: ELMAH_GetErrorsXml, ELMAH_GetErrorXml, ELMAH_LogError

Note that you can download the scripts from elmah website: http://code.google.com/p/elmah/

Then remove errorLog section from:

<elmah>
    <security allowRemoteAccess="0" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ApplicationServices" /> <!-- remove this section -->
</elmah
Throw and exception in your page and see if the error will show in elmah.axd. If it doesn't you can check the last error thrown by mssql, and in my case it's because of the column Sequence from table Elmah_Error not having Identity specification. Just set identity increment = 1 and identity seed = 1. That should solve the issue.
Elmah not logging, elmah.axd page is always null when using SqlErrorLog Elmah not logging, elmah.axd page is always null when using SqlErrorLog Reviewed by Edward Legaspi on Tuesday, February 07, 2012 Rating: 5

No comments:

Powered by Blogger.