Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 741231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:36:31+00:00 2026-05-14T08:36:31+00:00

I have installed/configured Elmah on my personal SharePoint dev environment and everything works great

  • 0

I have installed/configured Elmah on my personal SharePoint dev environment and everything works great since I’m logged in as admin, etc. I am using the MS Sql Server Error Log. (I am also using log4net to handle DEBUG/INFO/etc level logging and log statements are also stored in the db, in the same table as ELMAH’s.)

However, on the actual dev server (not my personal environment), when I access http://example/elmah.axd I get the error “Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON'”. I understand that this is the traditional error for the “double-hop problem” but I don’t even want my credentials to be passed along – I would just like the database access to be made with the credentials of the Application Pool Identity. When using the SP object model the SPSecurity.RunWithElevatedPrivileges is available; however, I do not want to modify the Elmah source.

My production environment precludes the use of SQL Server authentication, changing impersonation to false, or giving myself permissions on the db directly.

How can I get this to work? Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:36:31+00:00Added an answer on May 14, 2026 at 8:36 am

    My production environment precludes
    the use of SQL Server authentication,
    changing impersonation to false, or
    giving myself permissions on the db
    directly.

    Then you have no choice but to modify the Elmah source. Sorry.

    This has less to do with the double hop problem and more to do with the poorly documented mechanism of impersonation in ASP.NET. According to this article, apparently <identity impersonate="true" /> causes ASP.NET to impersonate the default IIS anonymous account (IUSR_machinename). SharePoint needs this but it does you no good trying to access a remote database, so there is obviously something you need to do.

    Yep, according to this article you must edit the Elmah source code and create a new class deriving from the abstract class ErrorLog. This new class then acts as a wrapper around the original SqlErrorLog class and runs its methods in a RWEP block. Here it is:

    public class SqlErrorLogWEP : ErrorLog
    {
        private SqlErrorLog sqlErrorLog;
    
        public SqlErrorLogWEP(IDictionary config)
        {
            sqlErrorLog = new SqlErrorLog(config);
        }
    
        public SqlErrorLogWEP(string connectionString)
        {
            sqlErrorLog = new SqlErrorLog(connectionString);
        }
    
        public override string Log(Error error)
        {
            string retVal = String.Empty;
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                retVal = sqlErrorLog.Log(error);
            });
    
            return retVal;
        }
    
        public override ErrorLogEntry GetError(string id)
        {
            ErrorLogEntry retVal = default(ErrorLogEntry);
    
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                retVal = sqlErrorLog.GetError(id);
            });
    
            return retVal;
        }
    
        public override int GetErrors(int pageIndex, int pageSize, System.Collections.IList errorEntryList)
        {
            int retVal = -1;
    
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                retVal = sqlErrorLog.GetErrors(pageIndex, pageSize, errorEntryList);
            });
    
            return retVal;
        }
    }
    

    It goes without saying that you will now need to reference SharePoint in the Elmah project and your Elmah.dll will need to be GACed. I’ve tested this myself and it works. Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed gitorious ruby application, configured apache passenger and vhost. Everything works fine
I have installed and configured SharePoint 2010 to run on the same box as
I have installed sqlserver as namedinstance first .say(sqlnamed).later i have installed sharepoint and configured
I have installed and configured tomcat+solr on my personal linux machine and windows as
I have installed and configured FreeTDS on my CentOS environment to enable my PHP
I have successfully installed and configured devise with an admin model with option 1
I am using Linux Mint 12, Kernel 3. I have installed and configured Open
I have installed Android SDK and packages. Since I had an error when opening
I have installed and configured django-postman based on documentation : in urls.py in root
I have installed and configured User Profile module, which allows me to add fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.