Every now and again, I check the epmsource logs to see what people have been searching for on the site. A couple of weeks ago I was surprised to see that people were searching for Correlation ID’s that are raised when an error occurs in Project Server or SharePoint. As a result, I thought a blog post might be appropriate to restate what Correlation ID’s are and how you can leverage them to gain insights into what is really going wrong.
In Project Server 2010 (and SharePoint 2010) when an error condition occurs, an error message may be displayed to the user that consists of an informative error message and a unique identifier (GUID) Correlation ID.
The Correlation ID is used to correlate or group individual log entries in SharePoint’s unified logging service (ULS) so that the exact log entries relating to an error can be identified. As the Correlation ID uses GUIDs, these ID numbers are always unique, so simply searching for the GUID is unlikely to give you any insights to a specific error occurring.
Tweaking ULS logging configuration
Whilst ULS logging is on by default, you may want to tweak the configuration slightly to increase the level of logging when trying to debug a specific error. To do so you will need to look in SharePoint’s Central Administration, within the Reporting > Configure Diagnostic Logging section.
Once selected, you have the ability to choose the different SharePoint farm components you wish to modify the logging level for.
For each farm component, there are two components that can be modified, the event log criticality and the trace log criticality.
Typically when you are trying to debug an error in PS2010, the Trace Log criticality should be configured to Verbose logging to ensure all possible information is recorded in the ULS logs, however it is very important that the logging is reduced back to the default once the error has been reproduced to reduce the amount of information being logged and to minimise the potential impact.
I have reproduced the error and logged it, now what?
Once the error has been reproduced, the next step is to open up the logs and look for the error. By default the ULS logs reside in the Program Files (x86)\Microsoft Shared\Web Server Extensions\14\LOGS directory on the application server, but the location and a few other settings can be configured via Central Admin.
Depending on the configuration chosen, a number of logs will be created, to find the correct log, check the date and time of the error message again the date modified value of the log files.
The log file itself contains relevant information including a timestamp, process area, the trace log criticality, message and a Correlation ID. From doing a find (CTRL + F in Notepad) in the file, it should be possible to find all the relevant log entries for the original error Correlation ID and from those entries to see more details about the error such as an exception or message.
As you can see from above, manually viewing the ULS logs can be a little bit difficult, especially if you have thousands of items to filter through. Thankfully Microsoft released a tool called ULSViewer which provides some smarts and assistance in viewing ULS logs.
With ULSViewer, it is possible to filter the log entries using user configurable filters such as time, event id and Correlation ID. Through a feature called Smart Highlighting, the whole log is parsed and related correlations automatically highlighted and finally when an error is found, clicking on it will show the error message or exception in an easy to read format. Whilst all of these features sound simple, they really do assist in the being able to drill down into the ULS logs and find all the relevant error messages to assist in further debugging of the problem.
Now none of the items discussed above will magically fix any problems you may be encountering, but they will assist in finding more information about the error itself and potentially provide direction on where to look to address the problem before raising a support ticket with Microsoft or requesting assistance from the community.