maoyuan121 / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Log the InnerException property and any other property that expose exceptions #178

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In addition to logging the details of the Exception that is logged, get the 
details of the InnerException property, if it is non-null, as well as any 
Exceptions exposed by the InnerException properties on those Exceptions.

Also, if there are other properties that expose Exceptions (or IEnumerable<T> 
where the base of T is Exception), then log those properties as well.

This will allow for a richer Exception report.  For example, Elmah catches a 
ReflectionTypeLoadException in my application.  However, what's really of more 
interest to me is the LoaderExceptions property, which has other exceptions; 
the Message property of ReflectionTypeLoadException is "Unable to load one or 
more of the requested types. Retrieve the LoaderExceptions property for more 
information."

This will be exceptionally important for .NET 4.0 as well, with the new 
AggregateException exception.

Original issue reported on code.google.com by ad...@sf4answers.com on 5 Jul 2010 at 3:32

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 19 Oct 2010 at 12:26

GoogleCodeExporter commented 9 years ago
Similar to the Exception Data dictionary, I think this would be an excellent 
addition.

Original comment by marc.c.l...@gmail.com on 28 Oct 2010 at 6:21

GoogleCodeExporter commented 9 years ago
I hope we'll see this implemented soon.
See also http://code.google.com/p/elmah/issues/detail?id=162

Original comment by fabrice....@gmail.com on 12 May 2011 at 2:58

GoogleCodeExporter commented 9 years ago
See also comment #12[1] in issue #162.

[1] http://code.google.com/p/elmah/issues/detail?id=162#c12

Original comment by azizatif on 12 May 2011 at 9:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Had a similar thought - but turned out we had a custom exception that wasnt 
calling base with the passed in exception.
As long as we do that, we got the details of the inner exception as this is 
included in the toString of Exception

For extending though - be nice if elmah exposed out assinging a Func to methods 
for getMessage and getDetails in error.cs - so something like:
Elmah.Error.GetMessage = (e) => e.Message + getExtraExceptionInfo(e);

That way anyone could extend and augment what got logged

Original comment by stevebak...@gmail.com on 9 Feb 2012 at 1:46

GoogleCodeExporter commented 9 years ago
hi, 
Any idea what version this enhancement will be added?

Original comment by andycw...@googlemail.com on 25 Mar 2012 at 3:04

GoogleCodeExporter commented 9 years ago
Bump, this would be useful.

Original comment by byte...@gmail.com on 15 May 2012 at 1:26

GoogleCodeExporter commented 9 years ago
really would like to see this too

Original comment by paul.car...@gmail.com on 9 May 2013 at 2:29

GoogleCodeExporter commented 9 years ago
This would be a great addition. I might see if I can't get it into a custom 
build for myself, if I do I'll provide a patch.

Original comment by kyleh...@gmail.com on 4 Oct 2013 at 12:52