本文介绍了ELMAH不会在生产时将错误日志插入SQL DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照所述为ELMAH配置了SQL Server 2008 R2 db,并且可以在开发中正常工作,但不能在生产中正常工作。开发和生产连接字符串目标均指向同一数据库,如果运行生产网站,Profiler不会显示插入SP。我不认为这是与SQL相关的问题。我已经阅读了一些帖子,例如

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

但即使我们遇到同样的问题,也没有一个能帮助我。

but even we have same problem, none of them helped me.

两个网站都能正常工作在Windows Server 2008 R2 / .net 4上。

Both websites work on Windows Server 2008 R2 / .net 4.

有什么想法吗? TIA。

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.

那么ELMAH在经典模式下不起作用吗?

So ELMAH doesn't work on classic mode?

推荐答案

可能是存储过程权限存在问题。
使用以下脚本(从生产系统中的连接字符串)向用户授予执行权限

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

这篇关于ELMAH不会在生产时将错误日志插入SQL DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 04:07