ASP.NET Exception Handling/Logging

后端 未结 7 912
感动是毒
感动是毒 2020-12-20 20:31

Is there an easy way to log all exceptions in an ASP.NET application? I\'m already logging unhandled exceptions through the Application_OnError event, but I want to perform

7条回答
  •  盖世英雄少女心
    2020-12-20 20:46

    I don't think there is anyway of automatically logging handled exceptions. If you're already doing the Application_OnError logging for unhandled exceptions I'm afraid that Colin's correct and you're going to have to call your logging component in the catch blocks for the handled exceptions you want logging for.

提交回复
热议问题