How to use System.NET tracing to troubleshoot content deployment issues and search issues in Windows SharePoint Services 3.0 and in SharePoint Server 2007

Article translations Article translations
Article ID: 947285 - View products that this article applies to.
Expand all | Collapse all

On This Page

SUMMARY

This article describes how to enable System.NET tracing to provide additional logging information for connection-related problems that may occur in Microsoft Windows SharePoint Services 3.0 environments and in Microsoft Office SharePoint Server 2007 environments.

INTRODUCTION

When you troubleshoot content deployment issues and search issues on a single-server installation or on multiple-server installations for which SSL is required, network tracing utilities such as Network Monitor, WireShark, and Sniffer cannot be used to display HTTP and SOAP data. HTTP and SOAP data helps isolate the cause of problems that are associated with SharePoint services. However, System.NET tracing was introduced in the Microsoft .NET Framework 2.0 to provide text-based logging of HTTP and SOAP payload data, socket information, and connection information.

Possible use scenarios

Scenario 1: Troubleshooting content deployment issues

When you troubleshoot content deployment issues, you may receive the following error message in the Crawl log:
Failed to communicate with destination server for Content Deployment job 'PublishJobName'. Exception was: 'System.Net.WebException: Unable to connect to the remote server.
Unfortunately, the Unified Logging Service (ULS) logs do not indicate why the connections to the remote server failed. If System.NET trace logs are created, it is likely that they would provide more information about the reason for the failure.

Scenario 2: Troubleshooting search and crawl issues

When you troubleshoot search and crawl issues, you may receive one or both of the following error messages in the Crawl log:
Crawling this document could not be completed because the remote server did not respond within the specified timeout. Try crawling the server later, or increase the timeout value. You may also try scheduling crawls during off-peak usage times.
An unrecognized HTTP status was received. Check that the address can be accessed using Internet Explorer.
Again, the ULS logs do not indicate why the connections to the remote server time out. However, System.NET trace logs could provide more information about the reason for the failure.

Although this article describes troubleshooting issues that are related to SharePoint Products and Technologies, System.NET tracing is a feature of the .NET Framework 2.0 and of later versions of the .NET Framework. Additionally, this article can be used to troubleshoot the .NET Framework applications that are not related to SharePoint Products and Technologies.

MORE INFORMATION

Background

Applications that call methods in the System.NET namespace of the .NET Framework 2.0 will check for the presence of a configuration file at process start (load time). This configuration file must have the same name as the application's executable file. Additionally, the configuration file must be located in the same folder as the executable file. This means that when the Windows SharePoint Services Timer service (SPTimerV3) starts, it checks for the presence of a file that is named Owstimer.exe.config in the folder that contains the Owstimer.exe file.

How to enable System.NET tracing for the Windows SharePoint Services Timer service

To enable System.NET tracing for the Windows SharePoint Services Timer service, follow these steps:
  1. Create a text file that is named Owstimer.exe.config in the following folder:
    %CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN
  2. In the Owstimer.exe.config text file, paste the following XML data.
    <?xml version="1.0" encoding="utf-8"?> 
    <configuration>
    	<system.diagnostics>
    		<trace autoflush="true" />
    		<sources>
    			<source name="System.Net">
    				<listeners>
    					<add name="System.Net"/>
    				</listeners>
    			</source>
    			<source name="System.Net.HttpListener"> 
    				<listeners>
    					<add name="System.Net"/>
    				</listeners>
    			</source>
    			<source name="System.Net.Sockets">
    				<listeners>
    					<add name="System.Net"/>
    				</listeners>
    			</source>
    			<source name="System.Net.Cache">
    				<listeners>
    					<add name="System.Net"/>
    				</listeners>
    			</source>
    		</sources> 
    	<sharedListeners>
    		<add
    		name="System.Net"
    		type="System.Diagnostics.TextWriterTraceListener"
    		initializeData="C:\\Tracing\\OWSTimer_SNtrace.log" traceOutputOptions = "DateTime" />
    	</sharedListeners>
    	<switches>
    		<add name="System.Net" value="Verbose" />
    		<add name="System.Net.Sockets" value="Verbose" />
    		<add name="System.Net.Cache" value="Verbose" />
    		<add name="System.Net.HttpListener" value="Verbose" />
    	</switches>
    	</system.diagnostics>
    </configuration>
  3. Save the Owstimer.exe.config file.
  4. Restart the Windows SharePoint Services Timer service. To do this, either use the Services MMC snap-in or type the following command in a Command Prompt window:
    net stop sptimerv3 & net start sptimerv3
This procedure forces the configuration file to be read. Additionally, this procedure enables logging. However, the folder that is listed in the initializeData attribute must exist. Additionally, the folder must have sufficient permissions to allow for file create and write operations to occur. For the Owstimer.exe.config file, the account is the Server Farm Account. For the Mssdmn.exe.config file, the accounts are the Search Service Account and the Search Content Access Account. These accounts are described in the Plan for administrative and service accounts (Windows SharePoint Services) guide. To obtain this guide, visit the following Microsoft Web site:
http://technet2.microsoft.com/windowsserver/WSS/en/library/89e4c579-5720-45e0-917e-abeb95266c3e1033.mspx
For general System.NET tracing, use the identity of the process for which tracing is enabled. To troubleshoot permissions problems that are related to creating the output trace logs, use Process Monitor. To obtain Process Monitor, visit the following Microsoft Web site:
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

How to enable System.NET tracing for the Office SharePoint Server Search service

To enable System.NET tracing for the Office SharePoint Server Search service (OSearch), follow these steps:
  1. Create a text file that is named Mssdmn.exe.config in the following folder:
    %ProgramFiles%\Microsoft Office Servers\12.0\Bin
    The contents of the Mssdmn.exe.config file are the same as the example of the Owstimer.exe.config, except for the initializeData attribute. Rename this attribute to create a log file name that is specific to the Mssdmn.exe process, as in the following example.
    initializeData="C:\\Tracing\\MSSDMN_SNtrace.log" 
  2. Restart the Office SharePoint Server Search service. To do this, either use the Services MMC snap-in or type the following command in a Command Prompt window:
    net stop osearch & net start osearch
This procedure forces the configuration file to be read. Additionally, this procedure enables logging. However, the folder that is listed in the initializeData attribute must exist. Additionally, the folder must have sufficient permissions to allow for file create and write operations to occur.

Note By default, installations of SharePoint Server 2007 have the following Search services installed:
  • Office SharePoint Server Search (OSearch)
    %ProgramFiles%\Microsoft Office Servers\12.0\Bin
  • Windows SharePoint Services Search (SPSearch)
    %CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN
Windows SharePoint Services 3.0 installations contain only one instances of the SPSearch service. When you create the Mssdmn.exe.config file, make sure that you put the file in the correct folder for troubleshooting the Search service that is experiencing problems. Also, if you are troubleshooting the Windows SharePoint Services 3.0 SPSearch service instead of the SharePoint Server 2007 OSearch service, make sure that you use net stop SPSearch and net start SPSearch instead of OSearch.

How to disable System.NET tracing

To disable System.NET tracing, follow these steps:
  1. Remove or rename the .config file that you created to enable the System.NET tracing. To do this, type the following command in a Command Prompt window, and then press ENTER:
    ren "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\owstimer.exe.config" owstimer.exe.config.disabled
  2. Restart the service. To do this, either use the Services MMC snap-in or type the following command in a Command Prompt window:
    net stop osearch & net start osearch

Permissions that are required to create and to write to System.NET trace logs

The only Windows permission that is required to create and to write to System.NET trace logs is the Write permission that is configured on the Security tab of the log folder properties dialog box. The trace logs will be created and written to in the security context of the service account for the component that is being monitored:
  • OWSTimer
    Farm service account
  • MSSDmn
    Search service account

Sample System.NET trace log output

The following example contains sample output that is generated by System.NET tracing from the Owstimer.exe process (the SPTimerV3 service).
System.Net Verbose: 0 : [2332] WebRequest::Create(http://sharepoint:56737/SearchAdmin.asmx)
    DateTime=2007-10-21T19:06:36.3058633Z
System.Net Verbose: 0 : [2332] HttpWebRequest#65198764::HttpWebRequest(http://sharepoint:56737/SearchAdmin.asmx#-2024304231)
    DateTime=2007-10-21T19:06:36.3058633Z
System.Net Verbose: 0 : [2332] Exiting HttpWebRequest#65198764::HttpWebRequest() 
    DateTime=2007-10-21T19:06:36.3214882Z
System.Net Verbose: 0 : [2332] Exiting WebRequest::Create() 	-> HttpWebRequest#65198764
    DateTime=2007-10-21T19:06:36.3214882Z
System.Net Verbose: 0 : [2332] HttpWebRequest#65198764::GetRequestStream()
    DateTime=2007-10-21T19:06:36.3214882Z
System.Net Warning: 0 : [2332] WebProxy failed to autodetect a Uri for a proxy script.
    DateTime=2007-10-21T19:06:36.3371131Z
System.Net Warning: 0 : [2332] WebProxy failed to autodetect a Uri for a proxy script.
    DateTime=2007-10-21T19:06:38.8058473Z
System.Net Information: 0 : [2332] Associating HttpWebRequest#65198764 with ServicePoint#4075575
    DateTime=2007-10-21T19:06:38.8058473Z
System.Net Information: 0 : [2332] Associating Connection#276258 with HttpWebRequest#65198764
    DateTime=2007-10-21T19:06:38.8058473Z
System.Net.Sockets Verbose: 0 : [2332] Socket#9116542::Socket(InterNetwork#2)
    DateTime=2007-10-21T19:06:38.8058473Z
System.Net.Sockets Verbose: 0 : [2332] Exiting Socket#9116542::Socket() 
    DateTime=2007-10-21T19:06:38.8058473Z
System.Net.Sockets Verbose: 0 : [2332] Socket#9116542::Connect(155:56737#-1694308128)
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net.Sockets Verbose: 0 : [2332] Exiting Socket#9116542::Connect() 
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Information: 0 : [2332] Associating HttpWebRequest#65198764 with ConnectStream#32410459
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Exiting HttpWebRequest#65198764::GetRequestStream() 	-> ConnectStream#32410459
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] ConnectStream#32410459::Write()
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Data from ConnectStream#32410459::Write
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 75 74 : .0" encoding="ut
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000020 : 66 2D 38 22 3F 3E 3C 73-6F 61 70 3A 45 6E 76 65 : f-8"?><soap:Enve
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000030 : 6C 6F 70 65 20 78 6D 6C-6E 73 3A 73 6F 61 70 3D : lope xmlns:soap=
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000040 : 22 68 74 74 70 3A 2F 2F-73 63 68 65 6D 61 73 2E : "http://schemas.
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000050 : 78 6D 6C 73 6F 61 70 2E-6F 72 67 2F 73 6F 61 70 : xmlsoap.org/soap
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000060 : 2F 65 6E 76 65 6C 6F 70-65 2F 22 20 78 6D 6C 6E : /envelope/" xmln
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000070 : 73 3A 78 73 69 3D 22 68-74 74 70 3A 2F 2F 77 77 : s:xsi="http://ww
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000080 : 77 2E 77 33 2E 6F 72 67-2F 32 30 30 31 2F 58 4D : w.w3.org/2001/XM
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000090 : 4C 53 63 68 65 6D 61 2D-69 6E 73 74 61 6E 63 65 : LSchema-instance
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000A0 : 22 20 78 6D 6C 6E 73 3A-78 73 64 3D 22 68 74 74 : " xmlns:xsd="htt
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000B0 : 70 3A 2F 2F 77 77 77 2E-77 33 2E 6F 72 67 2F 32 : p://www.w3.org/2
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000C0 : 30 30 31 2F 58 4D 4C 53-63 68 65 6D 61 22 3E 3C : 001/XMLSchema"><
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000D0 : 73 6F 61 70 3A 42 6F 64-79 3E 3C 49 50 41 64 64 : soap:Body><IPAdd
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000E0 : 72 65 73 73 20 78 6D 6C-6E 73 3D 22 68 74 74 70 : ress xmlns="http
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 000000F0 : 3A 2F 2F 6D 69 63 72 6F-73 6F 66 74 2E 63 6F 6D : ://microsoft.com
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000100 : 2F 77 65 62 73 65 72 76-69 63 65 73 2F 4F 66 66 : /webservices/Off
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000110 : 69 63 65 53 65 72 76 65-72 2F 53 65 61 72 63 68 : iceServer/Search
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000120 : 2F 53 65 61 72 63 68 57-65 62 53 65 72 76 69 63 : /SearchWebServic
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000130 : 65 22 20 2F 3E                                  : e" />
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Exiting ConnectStream#32410459::Write() 
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] ConnectStream#32410459::Write()
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Data from ConnectStream#32410459::Write
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000000 : 3C 2F 73 6F 61 70 3A 42-6F 64 79 3E 3C 2F 73 6F : </soap:Body></so
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] 00000010 : 61 70 3A 45 6E 76 65 6C-6F 70 65 3E             : ap:Envelope>
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Exiting ConnectStream#32410459::Write() 
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] ConnectStream#32410459::Close()
    DateTime=2007-10-21T19:06:38.8214722Z
System.Net Verbose: 0 : [2332] Exiting ConnectStream#32410459::Close() 
    DateTime=2007-10-21T19:06:38.8214722Z

Filtering System.NET trace logs

When verbose logging options are enabled in the App.exe.config file as described in this article, a review of the trace logs can be time-consuming. By using the TYPE and FIND commands, you can filter the verbose trace log to make the output more manageable. The following example shows any line that contains 0000 after all DateTime entries have been removed. The output is written to a file that is named Data.txt.

Type the following command at a Command Prompt window, and then press ENTER:
OWSTimer_SNtrace.log | find /V "DateTime=" | find "0000" > data.txt
If you use the previous sample trace log as input, the following data appears in the Data.txt file.

System.Net Verbose: 0 : [2332] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1
System.Net Verbose: 0 : [2332] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 75 74 : .0" encoding="ut
System.Net Verbose: 0 : [2332] 00000020 : 66 2D 38 22 3F 3E 3C 73-6F 61 70 3A 45 6E 76 65 : f-8"?><soap:Enve
System.Net Verbose: 0 : [2332] 00000030 : 6C 6F 70 65 20 78 6D 6C-6E 73 3A 73 6F 61 70 3D : lope xmlns:soap=
System.Net Verbose: 0 : [2332] 00000040 : 22 68 74 74 70 3A 2F 2F-73 63 68 65 6D 61 73 2E : "http://schemas.
System.Net Verbose: 0 : [2332] 00000050 : 78 6D 6C 73 6F 61 70 2E-6F 72 67 2F 73 6F 61 70 : xmlsoap.org/soap
System.Net Verbose: 0 : [2332] 00000060 : 2F 65 6E 76 65 6C 6F 70-65 2F 22 20 78 6D 6C 6E : /envelope/" xmln
System.Net Verbose: 0 : [2332] 00000070 : 73 3A 78 73 69 3D 22 68-74 74 70 3A 2F 2F 77 77 : s:xsi="http://ww
System.Net Verbose: 0 : [2332] 00000080 : 77 2E 77 33 2E 6F 72 67-2F 32 30 30 31 2F 58 4D : w.w3.org/2001/XM
System.Net Verbose: 0 : [2332] 00000090 : 4C 53 63 68 65 6D 61 2D-69 6E 73 74 61 6E 63 65 : LSchema-instance
System.Net Verbose: 0 : [2332] 000000A0 : 22 20 78 6D 6C 6E 73 3A-78 73 64 3D 22 68 74 74 : " xmlns:xsd="htt
System.Net Verbose: 0 : [2332] 000000B0 : 70 3A 2F 2F 77 77 77 2E-77 33 2E 6F 72 67 2F 32 : p://www.w3.org/2
System.Net Verbose: 0 : [2332] 000000C0 : 30 30 31 2F 58 4D 4C 53-63 68 65 6D 61 22 3E 3C : 001/XMLSchema"><
System.Net Verbose: 0 : [2332] 000000D0 : 73 6F 61 70 3A 42 6F 64-79 3E 3C 49 50 41 64 64 : soap:Body><IPAdd
System.Net Verbose: 0 : [2332] 000000E0 : 72 65 73 73 20 78 6D 6C-6E 73 3D 22 68 74 74 70 : ress xmlns="http
System.Net Verbose: 0 : [2332] 000000F0 : 3A 2F 2F 6D 69 63 72 6F-73 6F 66 74 2E 63 6F 6D : ://microsoft.com
System.Net Verbose: 0 : [2332] 00000100 : 2F 77 65 62 73 65 72 76-69 63 65 73 2F 4F 66 66 : /webservices/Off
System.Net Verbose: 0 : [2332] 00000110 : 69 63 65 53 65 72 76 65-72 2F 53 65 61 72 63 68 : iceServer/Search
System.Net Verbose: 0 : [2332] 00000120 : 2F 53 65 61 72 63 68 57-65 62 53 65 72 76 69 63 : /SearchWebServic
System.Net Verbose: 0 : [2332] 00000130 : 65 22 20 2F 3E                                  : e" />
System.Net Verbose: 0 : [2332] 00000000 : 3C 2F 73 6F 61 70 3A 42-6F 64 79 3E 3C 2F 73 6F : </soap:Body></so
System.Net Verbose: 0 : [2332] 00000010 : 61 70 3A 45 6E 76 65 6C-6F 70 65 3E             : ap:Envelope>

Known issues

The following issues have been known to prevent System.NET tracing logs from being generated:
  • The process that generates the trace logs was not restarted to allow for the .config file to be read.
  • Insufficient permissions exist for the monitored process for the folder in which the trace logs will be generated.
  • The process for which tracing is enabled does not use the System.NET namespace from the .NET Framework 2.0 runtime. Unfortunately, because of the various ways that managed code can be accessed, there is no easy way to determine whether the .NET Framework 2.0 version of the System.NET namespace was used to develop an application.
The following error message has been reported after enabling System.NET tracing when the SPTimerV3 service is started:
System error 1006 has occurred.
The volume for a file has been externally altered so that the opened file is no longer valid.
To resolve this issue, create the output folder where the log will be created (the value of the initializeData attribute in the Owstimer.exe.config file).
  • Depending on how much activity is performed by the monitored process, the trace log can grow large (several hundred megabytes) over the course of an hour or less. Therefore, logging should be enabled only for troubleshooting specific issues. Additionally, the output folder should be located on a volume that has sufficient space to accommodate a large amount of data.
  • After the System.NET trace log is created, the monitored process will maintain an open file handle to the trace log. To edit, move, or delete the trace log, the monitored process must be stopped. Trying to change the file while the owning process is running results in "File in use" message or an "Access is denied" message.

REFERENCES

For more information about System.NET tracing (also known as System.NET logging), visit the following Microsoft Web site:
http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx
To obtain online documentation for this feature of the .NET Framework, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/a6sbz1dx.aspx
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Properties

Article ID: 947285 - Last Review: February 4, 2008 - Revision: 1.0
APPLIES TO
  • Microsoft Office SharePoint Server 2007
  • Microsoft Windows SharePoint Services 3.0
Keywords: 
kbhowto kbinfo kbexpertiseadvanced KB947285

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com