ASP.NET Exception Handling/Logging

后端 未结 7 917
感动是毒
感动是毒 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:59

    Assuming you are only throwing and catching your own exception-types (derived from System.Exception ofc), you could make your base-exception log whatever you need in its constructor.

提交回复
热议问题