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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:13:42+00:00 2026-06-02T00:13:42+00:00

I have an Elmah filter setup in web.config to stop notification of certain error

  • 0

I have an Elmah filter setup in web.config to stop notification of certain error messages. But they still seem to come through. What could be the cause?

 <httpModules>
  <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
  <add name="SecuritySwitch" type="SecuritySwitch.SecuritySwitchModule, SecuritySwitch" />
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
  <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>

<errorFilter>
  <test>
    <regex binding="Exception.Message" pattern="(?ix: \b This \b.+?\b is \b.+?\b an \b.+?\b invalid \b.+?\b webresource \b.+?\b request \b )" />
  </test>
  <test>
    <regex binding="Exception.Message" pattern="(?ix: \b Path \b.+?\b eurl.axd \b )" />
  </test>
  <test>
    <regex binding="Exception.Message" pattern="(?ix: \b potentially \b.+?\b dangerous \b.+?\b value \b.+?\b detected \b.+?\b client \b )" />
  </test>
</errorFilter>
  • 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-02T00:13:43+00:00Added an answer on June 2, 2026 at 12:13 am

    I believe you can only have single test element. The key is to start with an <or></or> element and nest your filters in that. This certainly works for us.

    <errorFilter>
        <test>
            <or>
                <!-- Don't email 404 errors -->
                <and>
                    <equal binding="HttpStatusCode" value="404" type="Int32" />
                    <regex binding="FilterSourceType.Name" pattern="mail" />
                </and>
                <!-- Don't log cancelled downloads -->
                <and>
                    <equal binding="HttpStatusCode" value="500" type="Int32" />
                    <equal binding="Context.Request.ServerVariables['URL']" value="/Download.aspx" type="String" />
                    <or>
                        <regex binding="BaseException.Message" pattern="0x80070016" caseSensitive="false" />
                        <regex binding="BaseException.Message" pattern="0x800704CD" caseSensitive="false" />
                    </or>
                </and>
                <!--Viewstate Corruption-->
                <or>
                    <regex binding="Exception" type="System.Web.HttpException" pattern="System.FormatException: Invalid length for a Base-64 char array." caseSensitive="false" />
                    <regex binding="Exception" type="System.Web.HttpException" pattern="System.FormatException: Invalid character in a Base-64 string." caseSensitive="false" />
                </or>
                <!-- IE8 Bug -->
                <and>
                    <regex binding="Context.Request.ServerVariables['HTTP_USER_AGENT']" pattern="Trident\/4\.0" />
                    <or>
                        <equal binding="Context.Request.ServerVariables['URL']" value="/ScriptResource.axd" type="String" />
                        <equal binding="Context.Request.ServerVariables['URL']" value="/WebResource.axd" type="String" />
                    </or>
                </and>
            </or>
        </test>
    </errorFilter>
    

    More information here:

    http://www.diaryofaninja.com/blog/2011/09/20/adding-filters-to-your-elmah-installation

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

Sidebar

Related Questions

I have downloaded the latest ELMAH and copied the sample app's Web.Config settings to
I have the following settings in my web.config: <configSections> <sectionGroup name=elmah> <section name=security requirePermission=false
I would like to filter the ELMAH results declaratively in my web.config. I'm not
We have an Elmah configured to send error notification emails to us whenever something
I have ELMAH setup on my production server and it has done a fantastic
I have created a website using ASP.NET MVC and use ELMAH for error handling,
I try to run ELMAH with my ASP.NET MVC 2 project but have some
I have such section in my web.config to deny access of anonymous users to
I have it all set up and I can browse to /elmah.axd but I
I'm looking at using ELMAH for the first time but have a requirement that

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.