May 3, 2012 Leave a comment
If you receive a 500 (Internal Server Error) when running an application in IIS (SharePoint or otherwise), what can you do to resolve it? The ULS logs won’t show anything because the error happens before SharePoint or your web application has a chance to log an error. However, IIS has its own trace logging which can be easily turned on.
- Open IIS and click on the node for the site returning the error
- In the Actions pane on the right, click Failed Request Tracing…
- Check Enable
- In the center pane, click the Failed Request Tracing Rules icon
- In the Actions pane on the right, click Add…
- In the wizard that opens, click next to select all content
- Then check Status codes(s) and enter 500, or any other error codes you want to trace
- Click Next to select all trace providers, and the Finished
- You will now see logs get created for failed request in the following folder:C:\inetpub\logs\FailedReqLogFiles
- Clicking on one of the log files will display the following information. In this case we had a duplicate handler <add> element in the web.config – very easy to diagnose and correct with tracing enabled!