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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:31:23+00:00 2026-06-04T16:31:23+00:00

I have a query about the following web.config setup and Elmah. The problem is

  • 0

I have a query about the following web.config setup and Elmah. The problem is that it I still get emails regarding the public action method issues when I don’t want to. The filters I have in place don’t seem to be working.

I am not entirely sure how the ANDs and ORs are supposed to work in Elmah email filtering, especially as this code is snipped from some project work I have taken onboard from other developers.

The tags are meant to prevent any errors from being reported via email that contain any of the words Index, cache or Login.

Can anyone help?

<configuration>
    <configSections>
        <!--Elmah sectionGroup-->
        <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
        </sectionGroup>
  </configSections>  

 <elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
<errorMail from="" to="" subject="Error(Elmah)" async="true " />
    <security allowRemoteAccess="1"/>
<errorFilter>
  <test>
    <or>
        <is-type binding="BaseException" type="System.InvalidOperationException" />
</or>
<or>
    <regex binding="Exception.Message" pattern="(?ix: \b potentially \b.+?\b dangerous \b.+?\b value \b.+?\b detected \b.+?\b client \b )" />
</or>
<or>
    <regex binding="Exception.Message" pattern="(?ix: \b public action method     'Index' was not found on controller \b )" />
    <regex binding="Exception.Message" pattern="(?ix: \b public action method 'cache' was not found on controller \b )" />
    <regex binding="Exception.Message" pattern="(?ix: \b public action method 'Login' was not found on controller \b )" />
</or>
  </test>
</errorFilter>
  </elmah>  
  <location path="elmah.axd">
  </location>  
  <system.web>
  </system.web>
 <system.webServer>    
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</modules>
<handlers>
  <add name="httpHandler" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
   </handlers>
  </system.webServer>
</configuration>
  • 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-04T16:31:25+00:00Added an answer on June 4, 2026 at 4:31 pm

    The test element can only have one child assertion so having multiple or elements underneath it means all but the first are being ignored. From your description, it seems your test element should instead read like this:

    <test>
      <or> 
        <is-type binding="BaseException" type="System.InvalidOperationException" /> 
        <regex binding="Exception.Message" pattern="(?ix: \b potentially \b.+?\b dangerous \b.+?\b value \b.+?\b detected \b.+?\b client \b )" /> 
        <and> 
          <regex binding="FilterSourceType.Name" pattern="mail" />
          <regex binding="Exception.Message" pattern="(?ix: \b public \s action \s method \s '(Index|cache|Login)' \s was \s not \s found \s on \s controller \b )" /> 
        </and>
      </or> 
    </test>
    

    Note that I also went ahead and folded the three regex elements into one and fixed the pattern to delimit words correctly (\b on edges and \s inbetween).

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

Sidebar

Related Questions

I have a quite complex multi-join TSQL SELECT query that runs for about 8
I have about the following query: SELECT * FROM Product ORDER BY (SELECT CASE
I have a problem with the following Linq query using Entity Framework: from o
I have the following query that I've used to pull out a vehicle ID,
I have a query that contains about 10 joins. Using a List View and
I have a web app that has the following models: Shifts, Years, Checkouts, Sales
HI, I have this query about smart pointers. I heard from one of my
I'm always confusing about this stuff. I have this query : string[] names =
I have a question about my mysql query. I want to count the number
i have a general question about how sql server evaluates the joins.The query is

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.