If I have an application running on ASP.net and I have debug and stacktrace enabled in web.config, I get a really nice Error Screen telling me exactly which code caused the error.
Sadly on a live system where debug is set to false, the yellow screen of death is quite unhelpful, even with stack trace enabled, it does not show the line where the error happened (which seems obvious since there should be no debug information).
I just wonder if there is a way to get a good information about an error without having to enable debug=true in the web.config file. It does not have to be an improvement on the Yellow Screen, I can also wrap the code that I suspect to offend in a try..catch block, but then inside the catch block, is there a way to get to the actual code that caused the error?
As you may suspect, this is for a situation where an error only occurs in production and no remote debugger is available :(
Edit: This is concerning "normal" exception, like System.ArgumentOutOfRangeException. Littering the code with logging is something I would like to avoid if there is a better way just to get more information where the Exception actually occured.