Friday, September 16, 2016

Search from SharePoint Logs in SharePoint 2010

SharePoint logs are generated in all servers in a farm. So if you would like to find the log for your application issue, you need to look into all servers in the farm. Then you do not need to open ULS log file from each server rather you can use Merge-SPLogFile powershell command in one server to get the ULS logs from the entire farm and investigate it. 

Examples:

  • Get the logs for the correlation id between the time range

Merge-SPLogFile -Correlation "E0BB34790-4523-A353-046F-ABCD454E24D4" -StartTime "06/23/2015 17:10" -EndTime "06/23/20 17:15" -Path "e:\Sam\FarmMergedLog.log"

  • Get the logs for the message 'deadlock' between the time range

Merge-SPLogFile -Message "*deadlock*" -StartTime "06/23/2015 17:10" -EndTime "06/23/20 17:15" -Path "e:\Sam\FarmMergedLog.log"

Once the Merge log file got generated and you can open in ULS Viewer.

One more interesting thing is that you can also filter log files by specifying 'second' duration in the command. This is really required as thousands of logs generated in a minute. 

Example: Get the logs between the time range

Merge-SPLogFile -StartTime "06/23/2015 17:10:15" -EndTime "06/23/20 17:10:45" -Path "e:\Sam\FarmMergedLog.log"

To know more in details please refer the below link

http://technet.microsoft.com/en-us/library/ff607721.aspx

No comments:

Post a Comment