Exception.Message vs Exception.ToString()

后端 未结 7 880
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 06:44

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

7条回答
  •  独厮守ぢ
    2020-12-04 07:34

    Well, I'd say it depends what you want to see in the logs, doesn't it? If you're happy with what ex.Message provides, use that. Otherwise, use ex.toString() or even log the stack trace.

提交回复
热议问题