Diagnosing 500 Internal Server Errors from IIS

Windows 10 Setup

In short, setup failed request tracing feature on IIS

On Windows 10, let's first enable it

  1. netmgr > server > website > failed request tracing rules >
  2. edit site tracing > enable
  3. add > all content > status codes > 500

Then to view the logs

inetmgr > server > website > failed request tracing rules > view trace logs then find the fr*.xml related files, right click and open with IE Internet Explorer. Not sure why this doesn't open in a parsed format with Edge or any other browser.

Azure Setup

On Azure it is

azure portal > app service > myapp > diagnostic logs> failed request tracing > on

Then to view the logs

azure portal > app service > myapp > advanced tools > go to kudu scm panel > debug console > cmd > log files > W3SVC3XXXX then open with IE Internet Explorer.

Source

https://blogs.msdn.microsoft.com/benjaminperkins/2017/01/27/enable-failed-reuqest-tracing-for-an-azure-app-service-web-app/
https://blogs.msdn.microsoft.com/benjaminperkins/2016/06/15/lab-4-install-and-configure-failed-request-tracing/