I have code that is logging Exception.Message
. However, I read an article which states that it\'s better to use Exception.ToString()
. With the latt
In addition to what's already been said, don't use ToString()
on the exception object for displaying to the user. Just the Message
property should suffice, or a higher level custom message.
In terms of logging purposes, definitely use ToString()
on the Exception, not just the Message
property, as in most scenarios, you will be left scratching your head where specifically this exception occurred, and what the call stack was. The stacktrace would have told you all that.