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 latter, you retain more crucial information about the error.
Is this true, and is it safe to go ahead and replace all code logging Exception.Message
?
I'm also using an XML based layout for log4net. Is it possible that Exception.ToString()
may contain invalid XML characters, which may cause issues?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…