[Wish]_Customizing exception error messages

[Wish]_Customizing exception error messages

  
Hello,

We often use an extension to write logs to the Error Log table of Service Center (similar to the tip given at http://www.outsystems.com/NetworkForums/viewtopic.aspx?TopicId=2737) in order to write more information that could help to understand the reason that lead to the problem, like the username that was executing an action, value of important variables, etc.
We use this method because usually audits are disabled in production environments and are often used for debug logs, so trying to understand what happened when you have many users accessing your application could be a hard task. Also, with an error log you can write a lot more information than with an audit log (e.g.: you can output an entire XML that you were parsing instead of having only the first 200 characters).

When an exception is raised, you can choose to log the exception message and stack or not, but you cannot send additional information to that error log.
Although you can access the exception message with Session.ExceptionMessage, there is no way to get the stack. So, in order to get the best out of it, we end up logging two events for the same error: one by the error handler and another customized with some additional information.

My suggestion is to either create something like Session.ExceptionStack or allowing the user to log custom data in the Error Handler.