Troubleshooting SharePoint 2010, Part 1

by Tobias Lekman, 16 March, 2011

This is a quick video-based guide on how to troubleshoot errors and issues in SharePoint 2010. In this post, we will go through looking for detailed errors in logs, in code and finding what component causes issues on a specific page.

ULS Logs

The Unified Logging Service, or ULS, is a file-based log system that contains errors generated from SharePoint. It uses correlation ID to map the user error to the log entry. The files get large and are hard to navigate, so I recommend using the ULS Log Viewer on CodePlex.


In the following video, we will track down an error using correlation ID using the logs and the CodePlex log viewer:


Video: ULS logs and the LogViewer tool in SharePoint 2010. NOTE: Click Menu/CC to enable descriptive subtitles!

Enable Debugging and Detailed Errors

You can either edit the web.config of the web application and add the following changes:

  • <SharePoint><SafeMode CallStack="true" AllowPageLevelTrace="true" />
  • <system.web><customErrors mode="Off" />
  • <system.web><compilation debug="true" />

To make this a little bit easier, I have wrapped the changes in a feature that can be downloaded from CodePlex. The following video shows how to install the feature, enable debugging and see the difference in SharePoint:


Video: Enable Debugging and Detailer Error Information. NOTE: Click Menu/CC to enable descriptive subtitles!

Developer Dashboard

The developer dashboard is a page level tracing mechanism that allows you to view detailed information about the entire call stack in all modules that execute within the context of a page. This allows us to find detailed information about slow rendering of pages and see what component on the page is causing the issue.

You enable the dashboard using the command "stsadm -o setproperty -pn developer-dashboard -pv ondemand". The following video shows how to enable the dashboard.


Video: Enabling the Developer Dashboard in SharePoint 2010. NOTE: Click Menu/CC to enable descriptive subtitles!

The page trace shows different components and method calls in a hierarchical structure called a monitored scope. You can easily extend the trace within your own webpart by encapsulating your call in an SPMonitoredScope. For some good information on how to extend the trace using SPMonitoredScope, see Tobias Zimmergren's blog post "Developing for Performance, Part 2".