Saturday, May 17, 2014

Merge-SPLogFile: Merge SharePoint Log Files from Multiple Servers

Problem: In a multi-server SharePoint farm, if you need to trace an issue, you have to log-in and review the ULS logs on each server in the farm. This process could be tedious in multi-server farms since you're not sure on which server the error has occurred.


Solution: Use the Merge-SPLogFile PowerShell cmdlet.

The Merge-SPLogFile cmdlet will consolidate the logs from all servers in the SharePoint farm into a single log file. You can run it from any server and it gathers data from the entire farm - to find issues.

Here is some examples of Merge-SPLogFile:
 
Merge-SPLogFile -Path D:\ErrorLog.txt -StartTime "20/10/2014" -overwrite
Merge-SPLogFile -path "D:\ErrorLog.txt" -Correlation "Your-error-correlation-id" 
Here "path" refers to the log file name you want to create. If it already exists, use "Overwrite" switch. We can use parameters such as StartTime to specify the range of the log entries. There are other properties to help you narrow down the log search:
  • Area
  • Category
  • ContextFilter
  • Correlation
  • EndTime
  • EventID
  • Level
  • Message
  • Process
  • ThreadID
Tips: Use New-SPLogFile cmdlet to instruct SharePoint 2013 to start a new log file.

See the complete examples at Technet: Merge-SPLogFile Technet reference



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:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...