Should it not log Request.Form.ToString()

665 views
Skip to first unread message

simonwilbert

unread,
Jun 26, 2009, 8:59:51 AM6/26/09
to ELMAH
I've been using elmah on a few projects, but one item thats come up is
being able to replicate the exception more accuratley and for that I
need to know what the user passed in a http post.

I was going to modify the elmah code locally so it logged
Request.Form.ToString() in the emails that go into our public exchange
folder, but then thought it should really be a feature request for
this project.

Security would be an issue if http posts contained private information
if the site used ssl...

Any thoughts, feedback?

Atif Aziz

unread,
Jun 26, 2009, 9:15:47 AM6/26/09
to el...@googlegroups.com
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.

- Atif

simonwilbert

unread,
Jun 26, 2009, 9:21:41 AM6/26/09
to ELMAH
Understand that, and it makes sense. Could an emlah configuration be
given where by you could state the keys of the request.form for elamh
to report on, that way you could control the bloatedness easily.

maybe you could specify the keys individually or match keys on a
regular expression?

Either way i assume this would not be a feature request, so i should
do this development locally only?

On Jun 26, 2:15 pm, Atif Aziz <aziza...@gmail.com> wrote:
> 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.
>
> - Atif
>
> On Fri, Jun 26, 2009 at 2:59 PM, simonwilbert <simon.hur...@thomsonlocal.com
>
>
>
> > wrote:
>
> > I've been using elmah on a few projects, but one item thats come up is
> > being able to replicate the exception more accuratley and for that I
> > need to know what the user passed in a http post.
>
> > I was going to modify the elmah code locally so it logged
> > Request.Form.ToString() in the emails that go into our public exchange
> > folder, but then thought it should really be a feature request for
> > this project.
>
> > Security would be an issue if http posts contained private information
> > if the site used ssl...
>
> > Any thoughts, feedback?- Hide quoted text -
>
> - Show quoted text -

Atif Aziz

unread,
Jun 26, 2009, 11:58:09 AM6/26/09
to el...@googlegroups.com
It should be feature request as per your ideas. You can post it as an issue but there are no deadlines here :) so if you need it more urgently then I would recommend working out a local adaptation meanwhile, which can be achieved in a fairly modular way without resorting to modifying ELMAH sources.

- Atif
Reply all
Reply to author
Forward
0 new messages