Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elmah: How do I log form post data?

Is there a way to log the post request data in ELMAH?

I am getting error emails, and while the error log contains the URL, request method, etc, I am not seeing the actual POST data.

For example,

Here is a sample Actual request: /bep/KotexCode/GetCode?stickerCode=1234532

But, the log only shows the request url and not the variable stickerCode. Thanks!

Edit Sorry, I should have checked the project website, but it looks like this feature was requested. http://code.google.com/p/elmah/issues/detail?id=164

like image 276
Abe Avatar asked Oct 13 '10 01:10

Abe


People also ask

How do I check my Elmah log?

Build the application, run it in the browser, and navigate to http://www.yoursite.com/elmah.axd. You are prompted to log in before you see the content. After a successful authentication, you see a web page to remotely view the entire log of recorded exceptions.

Is elmah.io free?

Absolutely! Everyone can try elmah.io completely free for 21 days, no credit card required.


1 Answers

This was also addressed in the ELMAH discussion group, quoted below verbatim:

ELMAH actually does log all the form data. It is not displayed alongside server variables by default when you look at the error detail page but can be dug out of the raw XML view from the very same page. The form data, however, is also not included in e-mails.

The real reason for leaving out the display of form data was to avoid bloat and noise from a lot of ASP.NET applications with very large view states (hundreds of KB). Also, some forms include lots of HTML in textarea fields (especially CMS systems) that could also lead to large amounts of noise. In the absence of a single good solution that fit all sizes, the problem has been left as being outside the scope of ELMAH (though still open for discussion). If someone needs to display FORM data, a custom error detail page is very quick to code up.

like image 52
Atif Aziz Avatar answered Sep 21 '22 23:09

Atif Aziz