Classic ASP : Capture Errors

后端 未结 4 1911
深忆病人
深忆病人 2020-12-28 23:12

Is it possible to capture all 500 errors in Classic ASP at a global level? Maybe something in IIS. I\'m using II6 at the moment. I like to capture the error message and th

4条回答
  •  不思量自难忘°
    2020-12-29 00:02

    Yes, create an asp page which will log the error details to the database, and set this to be the 500 handler page in IIS as below.

    Use the Server.GetLastError object to get the details of the error in your handler script.

    It might be a good idea to log to a text file rather than a DB in your 500 handler for resiliency.

    Set Custom 500 Handler in IIS

提交回复
热议问题