Hello I have setup ELMAH in my project, but I am getting a lot errors like
System.Web.HttpException: A potentially dangerous Request.Path value
was detected from the client (:).
Generated: Sun, 26 May 2013 21:46:30 GMT
System.Web.HttpException (0x80004005): A potentially dangerous
Request.Path value was detected from the client (:). at
Yes, you can do this using error filtering in ELMAH and which is described in detail on the project wiki. In short, the following filter in your
web.config should do the job (assuming you have setup the modules configuration sections already):
<errorFilter> <test> <and> <regex binding="FilterSourceType.Name" pattern="mail" /> <regex binding="Exception.Message" pattern="(?ix: \b potentially \b.+?\b dangerous \b.+?\b value \b.+?\b detected \b.+?\b client \b )" /> </and> </test> </errorFilter>
<regex> condition filters based on the filtering source such that mailing will not occur. Check out the documentation on the wiki for full details.