elmah

Elmah reporting unwanted 404 errors

狂风中的少年 提交于 2019-12-19 05:14:35
问题 I am using Elmah for logging in a ASP.NET MVC project and I am recieving lots of 404 errors for a path /prx2.php which in turn is passing a hash as a querystring param. I assume this is a scanner trying to find vulnerabilities. Because I am not running PHP I am safe! However I would like to stop ELmah reporting this error. Whats the best way to exclude these types of errors from being reporting without actually creating a /prx2.php page. I also would like to do this in a config file rather

Customize elmah.axd output fields

拜拜、爱过 提交于 2019-12-19 02:15:48
问题 ELMAH shows host, code, type, error, user, date and time by default on its error log web page. Is there any way to configure it and show other fields like IP or REFERER? (source: googlecode.com) 回答1: ELMAH is open-source. You can download the source and make any modifications you like (within the terms of the license, of course.) You should be able to trap any data made available by the HttpConext.Request object. You'd have to modify the code that grabs and stores the data, and the database

Customize elmah.axd output fields

…衆ロ難τιáo~ 提交于 2019-12-19 02:15:10
问题 ELMAH shows host, code, type, error, user, date and time by default on its error log web page. Is there any way to configure it and show other fields like IP or REFERER? (source: googlecode.com) 回答1: ELMAH is open-source. You can download the source and make any modifications you like (within the terms of the license, of course.) You should be able to trap any data made available by the HttpConext.Request object. You'd have to modify the code that grabs and stores the data, and the database

Logging username with Elmah for WCF Webservices

混江龙づ霸主 提交于 2019-12-18 17:07:18
问题 We are using the approach described here to log our webservice errors with Elmah. And this actually works, but sadly the username beeing logged is empty. We did some debugging and found, that when logging the error in the ErrorHandler the HttpContext.Current.User has the correct User set. We also tried: HttpContext context = HttpContext.Current; ErrorLog.GetDefault(context).Log(new Error(pError, context)); and ErrorLog.GetDefault(null).Log(new Error(pError)); Without success. Any ideas on how

Filter on exception text in elmah

╄→гoц情女王★ 提交于 2019-12-18 13:39:13
问题 Is there a way to filter exceptions in elma using the exception message? Examples: "System.Web.HttpException: Request timed out." I don't want to filter out all HttpException, but only the timed-out requests. "System.Web.HttpException: Maximum request length exceeded." What I don't want to do is write own code for that. So is it possible to do this with the buildin-web.config configuration? Thank you! 回答1: Yes you can. Just use a regular expression to interrogate the message. See the example

Configuring custom authorization with ELMAH

浪子不回头ぞ 提交于 2019-12-18 13:37:42
问题 How can I configure ELMAH to display only for certain people without default ASP.NET authorization roles manager? I (as well as many others, I think) use my own authorization logic and build my projects from zero without using provided templates. I want to log errors but it seems that it is impossible to configure ELMAH (somehow override functionality) to make it work with some other authorization or even to make it work only for particular IP addresses. Since I will have access to web.config

In ELMAH with MVC 3, How can I hide sensitive form data from the error log?

。_饼干妹妹 提交于 2019-12-18 03:56:36
问题 Here is the scenario... User types his username. Types an "incorrect" password. Both username and password values are being passed to the Elmah error log via the Exception.Context.Request.Form["Password"] . It's a read-only value and cannot be modified. And no... I don't want to dismiss the exception (fail). We added ErrorLog Filtering programmatically: void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) { if (e.Exception is LogOnException) { ((HttpContext) e.Context).Request

ELMAH - Filtering 404 Errors

混江龙づ霸主 提交于 2019-12-17 18:28:17
问题 I am attempting to configure ELMAH to filter 404 errors and I am running into difficulties with the XML-provided filter rules in my Web.config file. I followed the tutorial here and here and added an <is-type binding="BaseException" type="System.IO.FileNotFoundException" /> declaration under my <test><or>... declaration, but that completely failed. When I tested it locally I stuck a breakpoint in void ErrorLog_Filtering() {} of the Global.asax and found that the System.Web.HttpException that

How to secure Elmah.axd?

末鹿安然 提交于 2019-12-17 17:38:17
问题 We're using Elmah as our error logging system for an app that will be going into production soon. It's extremely useful, but if it goes into production like this anyone in the world access the error log because all they have to do is visit ourdomain.com/elmah.axd . This is obviously not ideal. I originally intended to restrict access to that page only to IP addresses within our company, but now our SysAdmins are saying that's not possible. So I'm asking here how can I prevent access to this

Securing Elmah in ASP.NET website

对着背影说爱祢 提交于 2019-12-17 17:18:59
问题 I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial, with the only difference being the demo project is a web application and my project is a website. <add verb="POST,GET,HEAD" path="/admin/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> <location path="admin"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> With the leading "/" I receive the response that "The resource cannot be found.", if I remove the leading "