ULS Log Viewer in Sharepoint 2010

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 SharePoint log information. There are basically 3 kinds of log information to look for; they are:

  1. SharePoint 14 hive LOGS folder where the SharePoint log information is kept.
  2. IIS web application log files inside INETPUB LOGS folder.
  3. Windows Event log where the Service Application log information are kept.

What is ULS?

The 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 14 HIVE > LOGS folder. The unified view helps in understanding the problem in the order of activities.

Note: the SPDiagnosticsBase class in the Microsoft.SharePoint.Administration namespace enables writing a Trace Log in SharePoint 2010. This is the preferred way for SharePoint 2010 and it includes WriteTrace() and WriteEvent() methods to be overridden.

Who is the Intended Audience?

This tool can be used by the following type of audience:

  1. SharePoint Administrators
  2. Developers
  3. Architects

Download

You can download the tool from the following location:

http://archive.msdn.microsoft.com/ULSViewer

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

view-the-LOGS-files.jpg

The latest log file (sorted by date) should contain the latest log information as shown below:

latest-log-file.jpg

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 advantage:

  1. A better user interface to view the Log Information
  2. Filtering of log levels based on Basic, High, Verbose etc.
  3. Formatting of log information
  4. Real time Log Information Viewing
  5. Exporting of Log Information to CSV files
  6. Multiple Machine Log viewing
  7. It is Free

Download

You can download the tool from following location:

http://archive.msdn.microsoft.com/ULSViewer

On opening the preceding link you should get the following page:

ULS-Viewer.jpg

Click on the Downloads tab and download the file shown.

ULS-Viewer-initial-release.jpg

Starting with the Tool

After downloading you can execute the tool. The main screen looks such as shown below.

tools-ULS-viewer.jpg

Viewing a Log file

You can use the File > Open from > File menu to open a log file from the 14 hive LOGS folder.

Viewing-a-Log-file.jpg

As you can see there are Time, Server, Process, Product, Category, Level information for each rows listed.

Filtering the Rows

You can filter the rows using the tool bar buttons:

Filtering-the-Rows.jpg

The rows will be filtered accordingly.

Filtering-the-Rows1.jpg

Real time Tracing


Another advantage of the tool is Real Time Tracing. We can see the 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.

Real-time-Tracing.jpg

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 new log entries.

Command Line

The real time mode can be started using the command line too:

ULSLogViewer.exe realtime:FolderPath

Exporting to File


We can also export the selected lines to a File using the context menu.

Exporting-to-File.jpg

Smart Highlight

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.

Smart-Highlight.jpg

You need to click the Smart Highlight button to enable this view.

References

http://tinyurl.com/sp2010-ulsdoc

Summary

In this article we have explored the ULS Log Viewer tool. In real-life scenarios this tool should give time, cost & convenience advantages.

Up Next
    Ebook Download
    View all
    Learn
    View all