问题
I have configured an SQL Server 2008 R2 db for ELMAH as described and works fine on development but not production. Both development and production connection string targets to same db, profiler shows nothing for the insert SP if I run production web site. I do not think its a SQL related problem. I have read some posts like
Elmah not working on IIS7 server
Elmah 1.2 does not log to SQL on Windows 2008 IIS7.5 Integrated mode (but works locally)
but even we have same problem, none of them helped me.
Both websites work on Windows Server 2008 R2 / .net 4.
Any ideas? TIA.
UPDATE : The only difference is my web site works integrated mode on development, and classic on on production. If I change classic to integrated it works fine.
So ELMAH doesn't work on classic mode?
回答1:
it's probably problem with permissions to stored procedure. use following script to give execute permission to the user (from connection string in productive system)
GRANT EXECUTE ON ELMAH_GetErrorsXml TO USER_NAME
GRANT EXECUTE ON ELMAH_GetErrorXml TO USER_NAME
GRANT EXECUTE ON ELMAH_LogError TO USER_NAME
来源:https://stackoverflow.com/questions/6844824/elmah-doesnt-insert-error-logs-to-sql-db-on-production