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 9185011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:11:32+00:00 2026-06-17T19:11:32+00:00

How can I configure ELMAH to display only for certain people without default ASP.NET

  • 0

How can I configure ELMAH to display only for certain people without default ASP.NET authorization roles manager?

I (as well as many others, I think) use my own authorization logic and build my projects from zero without using provided templates. I want to log errors but it seems that it is impossible to configure ELMAH (somehow override functionality) to make it work with some other authorization or even to make it work only for particular IP addresses.

Since I will have access to web.config I tried to change these values in order to NOT display elmah by default.

<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="false" />

And when I want to view errors switch them from true to false and see errors, then switch back. But it seems that when I change these values all logs are erased.

What can I do?

  • 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-06-17T19:11:33+00:00Added an answer on June 17, 2026 at 7:11 pm

    I think the easiest approach would be to make some minor alterations to your custom authorization so the ELMAH authorization will work.

    Option 1: Set the FormsAuthentication cookie on login. This way, in the web.config the allow users="username" should work. On successful login you can set the cookie with
    FormsAuthentication.SetAuthCookie(theUsername, true).

    The ELMAH authorization would look something like:

    <location path="elmah.axd" inheritInChildApplications="false">
        <system.web>
           <authorization>   
             <allow users="theUserName" />
             <deny users="*" />
           </authorization>
        </system.web>
      ...other config settings
    </location>
    

    Option 2: If you are using putting users into roles, you can override the default role provider to use the function you made to get roles. This way is a little more involved but then lets you harness role-basing authentication in the web.config, which is really nice for securing things like static file (.pdf etc) delivery. I can add code for this if interested.

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

Sidebar

Related Questions

I'm attempting to configure ELMAH error logging in an ASP.NET 4 application using SQL
I can wire up Elmah to log Exceptions in my ASP.Net application and it
How I can configure two asp.net sites in IIS 6.0 to be accessible through
The users of my app can configure the layout of certain files via a
Can I configure the VS.NET 2008 IDE to use gcc as a compiler?
I'm using the errorMail functionality of Elmah to send an email when ASP.NET encounters
I am planning to use RAMJobStore for Quartz.net. From my reading, we can configure
I've added elmah to an asp.net mvc 4 application. Logging is working and now
How I can configure a datagridview so that the user can only move through
Couchbase .Net manual says that I can configure my client in this way: <couchbase><servers

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.