In this article we can explore the SharePoint 2010 free tool ULS Log Viewer. This is a tool from Microsoft and we are free to use it, but there is no
customer support for any issues or queries.
What is logging?
Eventually in the life cycle of a SharePoint deployment the Administrator and Developer need to look into the log information of SharePoint.
There are basically three kinds of log information to look for.
- SharePoint 14 hive LOGS folder where the SharePoint log information is kept.
- IIS web application log files inside the INETPUB LOGS folder.
- Windows event log where the Service Application log information is kept.
What is ULS?
ULS represents Unified Logging Service and it captures the following:
- Exceptions of SharePoint
- Logs by applications
The unified logging is stored in .log files in the 14 HIVE > LOGS folder. The unified view helps in understanding problems in the order of activities.
SPDiagnosticsBase class in the namespace
Microsoft.SharePoint.Administration enables writing Trace Logs in SharePoint 2010. This is the preferred way for
SharePoint 2010 and it includes the
WriteEvent() methods to be overridden.
Who is the intended audience?
This tool can be used by the following types of audience:
- SharePoint Administrators
You can download the tool from the following location: http://archive.msdn.microsoft.com/ULSViewer.
On opening the above link you should get the following page:
Click on the Downloads tab and download the file shown.
How to view the LOGS files?
We are actually interested in the first option of looking into the SharePoint 14 hive LOGS folder. You can open the folder and see that there are a number
of log files as shown below.
- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
The latest log file (sorted by date) should contain the latest log information as shown below:
So there involves a bit of clumsy tasks to view the log information of SharePoint.
What are the advantages of this tool?
The ULS Log Viewer tool provides the following advantages:
- A better user interface to view the log information.
- Filtering of log levels based on Basic, High, Verbose, etc.
- Formatting of log information.
- Real time log information viewing.
- Exporting log information to CSV files.
- Multiple machine log viewing.
- It is free.
Starting with the tool
After downloading, you can execute the tool. The main screen looks like that
Viewing a log file
You can use the File > Open from > File menu to open a log file from the 14 hive LOGS folder.
As you can see, there are Time, Server, Process, Product, Category, Level information for each row listed.
You can filter the rows using the toolbar buttons. The rows will be filtered accordingly.
Real time tracing
Another advantage of the tool is real time tracing. We can see real time log messages by watching the tool. For monitoring a folder for real time log messages, use the File > Open From > ULS menu item.
On enabling ULS monitoring, the Notifications List contains the source log file which contains the new log entries. Please note that the specified folder
can contain multiple log files.
Click on the Notifications List to see the source file which contains the new log entries.
The real time mode can be started using command line too:
Exporting to a file
We can also export selected lines to a file using the context menu.
The Smart Highlight button on the toolbar enables highlighting the contents of similar texts. For example, placing the mouse over Medium should highlight all the entries of type Medium.
You need to click the Smart Highlight button to enable this view.
In this article we have explored the ULS Log Viewer tool. In real life scenarios this tool should give time, cost,
and convenience advantages.
Jean Paul is a Microsoft MVP and Architect with 12+ years of experience. He is very much passionate in programming and his core skills are SharePoint, ASP.NET & C#.
In the academic side he do hold a BS in Computer Science & MBA. In the certification side he holds MCPD & MCTS spanning from .Net Fundamentals to SQL Server.
Most of the free time he will be doing technical activities like researching solutions, writing articles, resolving forum problems etc. He believes quality & satisfaction goes hand in hand.
You can find some of his work over here. He blogs at http://jeanpaulva.com