Click here to Skip to main content
15,879,474 members
Articles / Productivity Apps and Services / Sharepoint
Article

ULS Log Viewer

Rate me:
Please Sign up or sign in to vote.
4.50/5 (3 votes)
12 Sep 2012CPOL3 min read 58.7K   3   8
Exploring the SharePoint 2010 free tool, ULS Log Viewer.

Introduction

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.

  1. SharePoint 14 hive LOGS folder where the SharePoint log information is kept.
  2. IIS web application log files inside the INETPUB LOGS folder.
  3. 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.

Note: The 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 WriteTrace() and WriteEvent() methods to be overridden.

Who is the intended audience?

This tool can be used by the following types 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.

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

Image 1

Click on the Downloads tab and download the file shown.

Image 2

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

Image 3

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

Image 4

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:

  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 log information to CSV files.
  6. Multiple machine log viewing.
  7. It is free.

Starting with the tool

After downloading, you can execute the tool. The main screen looks like that shown below.

Image 5

Viewing a log file

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

Image 6

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

Filtering rows

You can filter the rows using the toolbar buttons. The rows will be filtered accordingly.

Image 7

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.

Image 8

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.

Command line

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

ULSLogViewer.exe realtime:FolderPath

Exporting to a file

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

Image 9

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.

Image 10

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

References

Summary

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
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

Comments and Discussions

 
GeneralMy vote of 4 Pin
brother.gabriel15-Oct-12 17:08
brother.gabriel15-Oct-12 17:08 
QuestionGetting Commandline to open ULS in realtime view Pin
brother.gabriel15-Oct-12 6:19
brother.gabriel15-Oct-12 6:19 
AnswerRe: Getting Commandline to open ULS in realtime view Pin
Jean Paul V.A15-Oct-12 12:46
Jean Paul V.A15-Oct-12 12:46 
QuestionRe: Getting Commandline to open ULS in realtime view Pin
brother.gabriel15-Oct-12 16:36
brother.gabriel15-Oct-12 16:36 
AnswerRe: Getting Commandline to open ULS in realtime view Pin
Jean Paul V.A15-Oct-12 16:41
Jean Paul V.A15-Oct-12 16:41 
BugRe: Getting Commandline to open ULS in realtime view Pin
brother.gabriel15-Oct-12 16:59
brother.gabriel15-Oct-12 16:59 
GeneralRe: Getting Commandline to open ULS in realtime view Pin
Jean Paul V.A15-Oct-12 17:03
Jean Paul V.A15-Oct-12 17:03 
NewsRe: Getting Commandline to open ULS in realtime view Pin
brother.gabriel15-Oct-12 17:06
brother.gabriel15-Oct-12 17:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.