Consider a multi-server SharePoint FARM where you come across an error and SharePoint provides you just a Correlation ID. It can get very tedious for the administrator to find the actual error, especially scanning the logs on all servers.
There is a much easier option available in PowerShell which will return logs for a particular Correlation ID from the entire FARM.
Merge-SPlogfile - PowerShell commandThe "Merge-SPlogfile" command will search the error logs for the given correlation error ID from all the servers in FARM.
The output file can be generated in the desired format (log, xls, etc) and placed on any location on the server.
Merge-SPLogFile -Path [FILE PATH] -Correlation [CORRELATION GUID]where,
Merge-SPLogFile = PowerShell Command
Path = Location where the output file is to be saved, along with File Name and extension
Correlation = The correlation id (GUID) of the error
Example -
Start SharePoint Management Shell (run as administrator) and execute below PowerShell command.
Merge-SPlogfile -Path C:\sp_error.xls -Correlation xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
This will generate a file named "sp_error.xls" at location C:\. The generated file will consist only errors related to the correlation id provided in the command.
If you want to understand how the correlation id is helpful in troubleshooting the error, read here - http://code2care.org/2015/an-unexpected-error-has-occurred
Comments:
- Can I use this PowerShell command to get logs from SharePoint Online site collection?
anon 19 Aug 2020 22:09:43 GMT
- solution does not work. i use sharepoint online in office 365.
anon 03 Feb 2020 06:34:11 GMT
- Further comments disabled!
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms..
- PowerShell iterate and get all SharePoint sites and sub sites
- SharePoint Online: Editing session has ended Message
- How to Share Microsoft SharePoint Site with Users or Groups
- How to delete SharePoint Online List Item using REST API
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- How to disable SharePoint subsite creation option for owners
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly.
- How to upload file programmatically to SharePoint Document Library using Server Object Model C# .Net
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Error when deleting SharePoint Online folder or file
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- How to generate client id and secret to register SharePoint App with OAuth
- How to delete SharePoint List Item programmatically using C#.Net
- How to retrieve all SharePoint Online List Items using Rest API
- [Solved] SharePoint Search Internal server error exception
- Create SharePoint Site Collection using PowerShell New-SPSite
- Fix SharePoint PowerShell error - The term Get-SPweb is not recognized as the name of a cmdlet function script file or operable program
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- SharePoint Server 2016 installation System Hardware requirements
- How to create SharePoint Online List Item using REST API
- Changed AD user display name showing old name in SharePoint
- Recommended size and resolution for SharePoint Online Site logo
- Microsoft 365: How to Turn Off Delve in SharePoint Online for All Users
- Fix - JioCinema Something Went Wrong Please Try Again Error 8001 while streaming IPL Cricket Live - HowTos
- Android Development - How to switch between two Activities - Android
- Git Rename master branch make to main using Command - Git
- Fix java.net.ProtocolException: Invalid HTTP method - Java
- List of Special Parameters/Variables in Bash Shell Scripting - Linux
- Truncate table using Java JDBC Example - Java
- How to install Anaconda on Mac (M1/M2 Mac) - Python
- How to calculate SUM in Excel on Mac with Examples - Microsoft