Monday, February 11, 2013

SharePoint 2013 Correlation ID - Get Detailed Error using PowerShell

Correlation IDs are introduced in SharePoint 2010 to uniquely identify each error encountered. Later, these correlation ids are used as a starting point reference to get the complete error details from ULS logs during troubleshooting issues.

How to check correlation id in SharePoint 2013?
While its possible to open ULS logs and search correlation ids, There are some easy ways to lookup correlation id errors in SharePoint 2013.

Here is a typical SharePoint 2013 sorry something went wrong" error page with correlation id.
sharepoint 2013 sorry something went wrong correlation id

Find SharePoint 2013 correlation id using PowerShell
Just get the correlation id SharePoint 2013 from the error page and pass it to the PowerShell cmdlet: Get-SPLogEvent. Here are some examples: Login to your SharePoint server(s), Open SharePoint 2013 management shell and replace the GUID with your correlation ID.
#Get all details of the error
Get-SPLogEvent | ?{$_.Correlation -eq "6922c76b-32f7-4e2e-af96-fbda88a77fa5"}

#Retrieve selective columns of the error 
Get-SPLogEvent | ?{$_.Correlation -eq "f53b559c-f70e-002f-694c-7d3b8b55f534"} | select Area, Category, Level, EventID, Message | Format-List

#Get sharepoint 2013 correlation id in error messages and send to file
Get-SPLogEvent | ? {$_Correlation -eq "3410f29b-b756-002f-694c-7a574ff74cab" } | select Area, Category, Level, EventID, Message | Format-List > C:\SPError.log

#Get all issues logged in the past 10 minutes
Get-SPLogEvent -starttime (Get-Date).AddMinutes(-10)

#Get Events between specific time frames
Get-SPLogEvent -StartTime "03/06/2015 18:00" -EndTime "03/06/2015 18:30" 

SharePoint 2013 correlation id viewer
There are some good tools outthere.
SharePoint 2013 correlation id location:
Usually, ULS logs are located at 14/15 hive's LOGs folder. E.g: "C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\15\LOGS"

SharePoint 2013 correlation id not in log?
ULS logs are specific to per WFE (Web Front End) server. So, In a multi-Server SharePoint farm, When users hit SharePoint 2013 sites and ended up in error page, that can be served by any one of the front end, with the error logged in the ULS logs folder of the particular web front end.

So, if SharePoint 2010 correlation id not in log, you got query all web front end's ULS logs with the specific correlation ID. Use the below method of querying SQL Server to get the error details regardless of the server.

Query SQL Server Database for a specific correlation ID:
In SharePoint 2013 search correlation id error can also be done by querying the Logging database. Its usually with name: WSS_Logging unless you change it! Query from ULSTraceLog view as:
SELECT [MachineName], 
    [Area],
    [Category],
    [Level],
    [EventId],
    [Message],
    [CorrelationId] 
FROM ULSTraceLog 
WHERE [CorrelationId] = '39C29F9C-6890-D07A-0D7C-5A3A7AB7BFF5'



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

1 comment :

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...