SharePoint24x7 It's all about SharePoint.

30Dec/140

Tips n Tricks – Navigating through SharePoint ULS logs using PowerShell

Posted by Joy

When troubleshooting SharePoint farms, ULS logs play a vital role. ULS logs are the entry point for both Administrator and Developers when they start investigating an issue in a SharePoint farm.

Usually ULS logs are created in the following directory in SharePoint servers:

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS

ULS log files are easier to locate among other log files since their file name start with the server name and followed by a the timestamp.

ULS Logs directory

ULS logs contains very detailed information compared to Windows Event Logs. Following is a sample of a ULS log file:

ULS Logs

One of the big challenges/ pain point with regard to ULS logs are reading/ navigating through them. Since they are very detailed, going through them is really challenging. When we open a ULS log file, by default it opens in Notepad and it is really difficult to navigate through them.

Most of us try using lot of 3rd party tools for navigating through ULS logs without knowing that PowerShell also provide a powerful option for us to navigate through ULS logs.

Open SharePoint 2013 Management Shell and issue the following PowerShell command:

Get-SPLogEvent | Out-GridView

PowerShell command

This command will open up a new windows with a Grid View view of ULS log file. This allows us to navigate and filter ULS log entries easily compared to Notepad.

ULS Log Grid View

ULS Log Grid View Filtering