We have an MVC application that utilizes the ELMAH module to log any errors that are encountered by our users.

Our DBAs have moved our ELMAH table and stored procedure into a new schema on a database. So now, the default ELMAH pages are failing to access the ELMAH stored procedures and tables since they reside under 'Foo.ELMAH_Error', instead of just 'ELMAH_Error'.

Is there any way to tell the ELMAH module that the table now exists in a new schema?

有帮助吗?

解决方案

In the end, I got this to work by creating a new user for who has full access to the ELMAH procs & tables. I set the default database for the user to the new schema.

This solution appears to work well.

其他提示

You can create synonyms for ELMAH related objects as follows: Following is for SQL Server. You can apply similar changes if you are using any other databases but may need some changes to syntax.

Create synonym ELMAH_Error for [YourSchema].ELMAH_Error;
Create synonym ELMAH_GetErrorsXml for [YourSchema].ELMAH_GetErrorsXml;
Create synonym ELMAH_GetErrorXml for [YourSchema].ELMAH_GetErrorXml;
Create synonym ELMAH_LogError for [YourSchema].ELMAH_LogError;

After this, ELMAH log to sql will work as usual.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top