How to Use ULS Log Viewer to Analyze SharePoint Errors?
Introduction
If you’re a SharePoint administrator or developer, you know how crucial it is to have the right tools at your disposal for troubleshooting and diagnosing issues. One such tool that can be incredibly helpful is the ULS Viewer, which allows you to view and analyze the Unified Logging Service (ULS) logs generated by SharePoint. In this comprehensive guide, we’ll dive into the details of how to use ULS Viewer to reveal actual error messages in the SharePoint 2013/2016 environments to troubleshoot errors effectively.
What is ULS Viewer?
ULS Viewer is a powerful tool designed to help SharePoint professionals view and analyze ULS logs. These logs contain valuable information about various events, errors, and warnings that occur within your SharePoint environment. By using ULS Viewer, you can gain insights into the inner workings of SharePoint and quickly identify and resolve issues.
ULS Viewer offers several benefits, including:
- Real-time monitoring of SharePoint logs
- Detailed information about each log entry
- Advanced filtering capabilities
- Improved troubleshooting efficiency
- Supports aggregation, filtering, sorting, highlighting, append, and more
By using ULS Viewer, you can gain insights into the inner workings of SharePoint and quickly identify and resolve issues, ultimately enhancing the performance and stability of your SharePoint environment.
Scenario
ULS logs are unavoidable in SharePoint administration and support. You got an Email from an end-user saying they received a typical “An unexpected error has occurred.” page with some GUID, timestamp, etc. The user forwards the error screenshot to the SharePoint support team.
How to get the detailed error message using ULS Viewer?
Every request SharePoint receives, assigns a correlation ID in the form of a GUID. Whenever SharePoint presents an error to an end-user, it includes the correlation ID as part of the error message. It could be challenging to find the detail that you need from an unformatted text file. However, The ULS Viewer tool lets us open and analyze ULS log files in a user-friendly format. Here is how to use SharePoint ULS viewer:
- To start, Download the ULS Viewer tool to your SharePoint Web front-end server. It’s a tiny Click-and-run Windows application, no installation is required.
- Open ULS Viewer application. Click on the File Menu >> Open From >> File. This opens the default SharePoint LOGS folder of your SharePoint hive, from file system, “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS”. Â
- Select log file(s) based on the time stamp from the error page. You can select multiple log files at once.
- Once logs files are opened, apply the filter with your correlation GUID by clicking the “Filter” icon from the toolbar. Set the correlation value to the GUID we received in the error screen.
- This filters all detailed error messages of the specific correlation ID and provides a simplified view of ULS log files in human readable format.
Please note that this searches logs only within the current web front end. If you have multiple web front-end servers, you must repeat this step on all servers of your SharePoint farm. To monitor live ULS logs, Use File >> Open From >> ULS (Ctrl + U) option!
Real-Time Log Monitoring
ULS Viewer isn’t just for analyzing past events; it can also monitor logs in real time. To view logs in real-time, select “Open From” in the ULS Viewer and choose “ULS”. This allows you to connect directly to the SharePoint server’s log stream. Ensure you have the necessary permissions to access these logs.
Saving and Exporting Logs
Sometimes, troubleshooting is a team effort. You can export log data from ULS Viewer for offline analysis or share it with team members for collaborative troubleshooting.
- To save a snapshot of the current log entries, go to the “File” menu and select “Save.”
- Select a location and file name for the saved log file.
- To export logs in a specific format (e.g., CSV or XML), go to the “File” menu and select “Export.”
Conclusion
ULS Viewer is an indispensable tool for any SharePoint professional looking to streamline troubleshooting and optimize their SharePoint environment. By following the steps outlined in this guide and adopting best practices, you can leverage ULS Viewer to gain valuable insights, quickly identify and resolve issues, and ensure the smooth operation of your SharePoint deployment. Remember, investing time in mastering ULS Viewer will pay off in the long run, saving you countless hours of troubleshooting and enhancing your overall SharePoint experience.
You can also use the PowerShell cmdlet Get-SPLogEvent to get error details from the correlation ID. Here is the PowerShell script: How to get detailed error from Correlation ID using PowerShell
The correlation ID is provided in the error message itself or can be found using ULS Viewer by filtering logs around the time the error occurred.
No, ULS Viewer is specifically designed for SharePoint and works with SharePoint’s ULS log format.
Adjust the SharePoint Diagnostic Logging settings to capture only essential information and regularly archive old logs.
No, ULS Viewer is for SharePoint on-premises. Microsoft does not provide access to ULS logs in SharePoint Online due to security reasons. SharePoint Online uses different logging mechanisms accessible through the Microsoft 365 admin center.
ULS Viewer is officially supported for On-premises versions of SharePoint 2010, 2013, 2016, and 2019. The log structure remains consistent across these versions, so the same ULS Viewer can be used for all.
ULS Viewer is a portable application. Simply download and run the tool. You can then open Microsoft SharePoint ULS logs, filter them by various criteria like timestamps or correlation IDs, and analyze the log entries.
While ULS Viewer is a user-friendly option, you can also use PowerShell cmdlets to filter and analyze ULS logs in SharePoint Server. This method offers more flexibility but requires some PowerShell scripting knowledge.
To filter logs by Correlation ID, use the filter feature in ULS Viewer. Enter the specific Correlation ID into the filter criteria under the appropriate field (usually “Correlation”). This will display only the log entries associated with that Correlation ID, facilitating easier debugging of specific issues.