Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Catch Error details on IIS Custom Error Page

Using web.config I configured IIS to redirect 500 errors to a custom page that is in my application.

<httpErrors errorMode="Custom">
        <remove statusCode="500" />
        <error statusCode="500" path="/Pages/ErrorPages/CustomError.asp" responseMode="ExecuteURL" />
    </httpErrors>

This is working perfectly and it is redirecting to the mentioned classic asp page when there is a 500 error.

Now I want to capture the error details such as file path and line number from my custom error page, which shows on the standard error page when we set "Send errors To Browser" to TRUE and Error page features to "Detailed errors"

What are the methods I can use to solve this by configuring IIS and using javascript/jquery

Send errors To Browser Error page features Sample standerd detailed error

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As the Detailed Error overrides the content of my custom error page, I came up with a different approach to overcome my problem.

I Enabled Failed Request Tracking Rule on IIS and it creates a log folder inside inetpub\logs\FailedReqLogFiles

enter image description here

Inside that folder, It creates a separate error log (XML) for each Error. That XML has a format like below.

<failedRequest url="" siteId="" appPoolId="" processId="" verb="GET" remoteUserName="" userName="" tokenUserName="NT AUTHORITY\IUSR" authenticationType="anonymous" activityId="" failureReason="STATUS_CODE" statusCode="500" triggerStatusCode="500" timeTaken="" xmlns:freb="">
<Event>
<System></System><EventData></EventData><RenderingInfo></RenderingInfo><ExtendedTracingInfo></ExtendedTracingInfo>
</Event>
<Event>
<System></System><EventData></EventData><RenderingInfo></RenderingInfo><ExtendedTracingInfo></ExtendedTracingInfo>
</Event>
...
...
</failedRequest

I looped through Event tags and Selected the one with Event>System>Level is equal to 2. That is the event it shows as an Error when you preview the XML. Then you can read Event>EventData for Error LineNumber and Description.

From my custom error page, I requested information using an XHR call and stored it in a hidden field until required.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!