Monday, 4 May 2015

SharePoint work With Correlation Id's


Troubleshoot issues with Microsoft SharePoint Foundation.

In SharePoint 2010 Microsoft added Correlation ID features.
Correlation ID: Whenever you receive any error in SharePoint 2010, it generates logs with a unique Correlation ID. Then we go in to Web front end server and find this error by Correlation ID. The main problems come when we have multiple Web Front End servers.
Then we need to do quite big exercise to find the errors. The PowerShell provides us very robust command for check the ULS logs by Correlation ID.

You can run this command and get result in various forms.

For get result in command prompt.
Get-SPlogEvent I ?{$_.Correlation -eq "<GUID>' I select Area, Category, Level,
EventlD,  Message  I Format-List
e.g: Get-SPlogEvent I ?{$_.Correlation -eq "4aee5136-Bae1-4a26-bbe4- cb50001bc113 j  I select Area, Category, Level, EventlD, Message I Format-List

For get result as log file or as text file.

Get-SPlogEvent  I ?{$_.Correlation  -eq  "<GUID>''} I select Area,   Category, Level,
EventID, Message I Format-List  > C:\Error.log
e.g.: Get-SPlogEvent I ?{$_.Correlation -eq "4aee5136-8ae1-4a26-bbe4- cb50001bc113' ') I select Area, Category, Level, EventlD, Message I Format-List > C:\Error.log

If you have any time slot then you can get faster result.

Get-SPLogEvent -StartTime YYYY-MM-DDTHH:mm:ss I ?{$_.Correlation -eq "
<GUID> j I select Area, Category, Level, EventlD, Message I Format-List >
C:\SPError.log

-------------------------------------------------------------------------------------------------------


Correlation ID: c0586a9f-b212-43bd-9154-8382608a1752

Date and Time: 4/19/2015 5:22:10 AM

Example:

Get-SPLogEvent -StartTime 2015-04-19T5:22:10 | ?{$_.Correlation -eq "c0586a9f-b212-43bd-9154-8382608a1752"} | select Area, Category, Level, EventID, Message | Format-List > E:\Error1.txt

------------------------------------------------------------------------------------------------------------

Merge-Log:

Merge-SPLogFile –Path “E:\MergedLogs.log” –Correlation c0586a9f-b212-43bd-9154-8382608a1752 -Overwrite

No comments:

Post a Comment