Filtering Help

17 views
Skip to first unread message

TonyB

unread,
Jul 14, 2009, 5:43:49 PM7/14/09
to ELMAH
I'm trying to get ELMAH to filter out an error we are getting and am
having some problems.

We already have 3 filter lines working to filter out exceptions on our
test environment (by checking if SERVER_NAME is one of the development
boxes).

The filter I'm trying to add is something like "If the Browser is IE8
(User agent contains Trident/4.0) and it is a specifc url"

Here is what I a tried but it is not working.
<errorFilter>
<test>
<or>
<equal binding="Context.Request.ServerVariables
['SERVER_NAME']" value="localhost" type="String" />
<equal binding="Context.Request.ServerVariables
['SERVER_NAME']" value="10.10.2.101" type="String" />
<equal binding="Context.Request.ServerVariables
['SERVER_NAME']" value="10.10.5.10" type="String" />
<and>
<regex binding="Context.Request.ServerVariables
['HTTP_USER_AGENT']" pattern="Trident\/4\.0" />
<equal binding="Context.Request.ServerVariables['URL']" value="/
MyApp/ScriptResource.axd" type="String" />
</and>
</or>
</test>
</errorFilter>


Any ideas on why it is not filtering out my errors? I also tried a
jscript version of the above without any success.

Atif Aziz

unread,
Jul 16, 2009, 7:31:27 AM7/16/09
to el...@googlegroups.com
Your filter looks fine and should be working. I mocked up the environment to test your filter in a simple console application and it works fine given the right context and conditions. See the attached code. I've also posted it online at: http://gist.github.com/148371

- Atif
test.cs

Tony Bunce

unread,
Jul 16, 2009, 9:57:03 AM7/16/09
to el...@googlegroups.com

Thanks for the help.

 

I must have had a typo in my web.conf or something because I delete it and re-entered and now it is working

 

Thanks,

Tony

Reply all
Reply to author
Forward
0 new messages