开发者

Elmah: How do I log form post data?

开发者 https://www.devze.com 2023-01-19 22:42 出处:网络
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.

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 s开发者_如何学GotickerCode. 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消