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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:01:31+00:00 2026-05-30T05:01:31+00:00

I started using ELMAH and I think its great. I read some documentation online

  • 0

I started using ELMAH and I think its great. I read some documentation online but right now my app doesn’t have roles/user authorization setup.

I would like to be able to read the error logs on production by accessing /elmah.axd but I don’t want to just open it up to everyone, does elmah have any functionality that would allow me to create a password (in web.config) and pass it via querystring? Mimicking a “secure” RSS feed. Or something similar ofcourse….

  • 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-30T05:01:33+00:00Added an answer on May 30, 2026 at 5:01 am

    but right now my app doesn’t have roles/user authorization setup

    Actually it’s not that hard to configure forms authentication:

    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880">
        <credentials passwordFormat="Clear">
          <user name="admin" password="secret" />
        </credentials>
      </forms>
    </authentication>
    

    and then protect elmah.axd:

    <location path="elmah.axd">
        <system.web>
          <authorization>
            <deny users="?"/>
          </authorization>
        </system.web>
    </location>
    

    and finally you could have an AccountController:

    public class AccountController : Controller
    {
        public ActionResult LogOn()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult LogOn(string username, string password)
        {
            if (FormsAuthentication.Authenticate(username, password))
            {
                FormsAuthentication.SetAuthCookie(username, false);
                return Redirect("~/elmah.axd");
            }
            else
            {
                ModelState.AddModelError("", "The user name or password provided is incorrect.");
            }
            return View();
        }
    }
    

    and a LogOn.cshtml view:

    @Html.ValidationSummary(false)
    
    @using (Html.BeginForm()) 
    {
        <div>
            @Html.Label("username")
            @Html.TextBox("username")
        </div>
        <div>
            @Html.Label("password")
            @Html.Password("password")
        </div>
        <p>
            <input type="submit" value="Log On" />
        </p>
    }
    

    Now when an anonymous user tries to access /elmah.axd he will be presented with the logon screen where he needs to authenticate in order to access it. The username/password combination is in web.config. I have used passwordFormat="Clear" in this example but you could also SHA1 or MD5 the password.


    Of course if you don’t want to configure authentication you could also configure elmah to store logging information in a XML file or SQL database and then completely disable the elmah.axd handler from your publicly facing website. Then create another ASP.NET site which only you would have access to with the same elmah configuration pointing to the same log source and simply navigate to the /elmah.axd handler of your private site to read the logs of your public site.

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

Sidebar

Related Questions

I started using Sandcastle some time ago to generate a Documentation Website for one
I started using Wing IDE and it's great. I'm building a wxPython app, and
I started using Prestashop yesterday so I’m a total beginner, but I've got some
Just started using App Engine's webapp framework, but I can't figure out what's wrong
Just started using Blueprint CSS and now playing with the grids but have a
I started using ActiveAdmin recently in a project and almost everything works great but
I just started using ELMAH and am a fan. My team supports a large
I started using bundler (which is to my eyes a pure disaster). Now I
i started using nginx upload module (which creates upload files like /tmp/000121545) but i
I started using git to track my customizations to a 3rd party web app.

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.