I ran into this problem where an exception wasn't being logged, and when I looked at the stack trace found myself somewhat confused... Is this a bug? If not, how should this be dealt with to log such exceptions?
I was not asking how to solve the problem. It's already taken care of. My problem is that Elfar did not Log the exception, and the reason is unclear to me. The stack trace seems to indicate that when Elfar is trying to log the exception it somehow execute some Infrastructure code and it doesn't end up logging anything.
I'm asking if this is a bug in Elfar, and if not how can I fix it so that these kinds of exceptions will in fact be logged. It seems like in order to log the exception, it has to validate the input.. which doesn't seem right to me.
Last edit: Erik Funkenbusch 2012-06-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Erik, one of the purposes of Elfar is to record user input, which means extracting information from Request.Form. It is during the process of extracting this information that the infrastructure code is being called. Elfar is not calling it directly and cannot avoid it.
I have updated the Collection.cs file to handle this scenario but now have another problem. There is now an error, in the details page, when rendering the stack trace, as the format for the validation exception is very different to other exceptions. I am working on fixing this and will inform you when I have updated the nuget package.
Last edit: Steven Bey 2012-06-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I ran into this problem where an exception wasn't being logged, and when I looked at the stack trace found myself somewhat confused... Is this a bug? If not, how should this be dealt with to log such exceptions?
Erik, the message of the exception explains what the problem is. Have a look at this blog post for an explanation and solution.
Steven,
I was not asking how to solve the problem. It's already taken care of. My problem is that Elfar did not Log the exception, and the reason is unclear to me. The stack trace seems to indicate that when Elfar is trying to log the exception it somehow execute some Infrastructure code and it doesn't end up logging anything.
I'm asking if this is a bug in Elfar, and if not how can I fix it so that these kinds of exceptions will in fact be logged. It seems like in order to log the exception, it has to validate the input.. which doesn't seem right to me.
Last edit: Erik Funkenbusch 2012-06-06
Erik, one of the purposes of Elfar is to record user input, which means extracting information from
Request.Form. It is during the process of extracting this information that the infrastructure code is being called. Elfar is not calling it directly and cannot avoid it.I have updated the
Collection.csfile to handle this scenario but now have another problem. There is now an error, in the details page, when rendering the stack trace, as the format for the validation exception is very different to other exceptions. I am working on fixing this and will inform you when I have updated the nuget package.Last edit: Steven Bey 2012-06-08
Erik, I've fixed the stack trace problem and published the update nuget package.
Thank you for all of the feedback that you've provided.