Microsoft KB Archive/890614

= How to enable query logging in SharePoint Portal Server 2003 =

Article ID: 890614

Article Last Modified on 2/8/2007

-

APPLIES TO


 * Microsoft Office SharePoint Portal Server 2003

-



INTRODUCTION
This article describes how to enable query logging in Microsoft Office SharePoint Portal Server 2003. When you enable query logging, search terms that users use to search SharePoint Portal Server 2003 are logged in the Microsoft Internet Information Services (IIS) 6.0 log files.



MORE INFORMATION
To enable query logging in SharePoint Portal Server 2003, you must set certain properties for the Search Results Web Part. The properties that you can set for the Search Results Web Part are described as follows:  To log information that includes the search terms, the name of the search server, and the Best Bets keyword count, add the following line to the SearchResults.dwp file:

True

 To log the whole query string, add the following lines to the SearchResults.dwp file:

True

True



To enable query logging in SharePoint Portal Server 2003, follow these steps:  Connect to the portal site, and then click Site Settings.</li> Under General Settings on the Site Settings page, click Manage security and additional settings.</li> Under Templates and Web Parts on the Manage security and additional settings page, click Manage Web Part gallery.</li> Click New Web Part on the Web Part Gallery page.</li> Click to select the Microsoft.SharePoint.Portal.WebControls.SearchResults check box, and then click Populate Gallery.</li> In the Edit column, click the Edit Document Properties button that appears next to SearchResults.dwp in the list of Web Parts.</li> Click Export on the Web Part Gallery: SearchResults.dwp page, and then click Save in the File Download dialog box.</li> Specify a location where you want to save the SearchResults.dwp file, and then click Save.</li> Start Notepad, and then open the SearchResults.dwp file that you exported.</li> Do one of the following, depending on your situation:  Under the <Title>SearchResults</Title> section of the SearchResults.dwp file, add the following line:

True</EnableQueryLogging>

</li> Under the <Title>SearchResults</Title> section of the SearchResults.dwp file, add the following lines:

True</EnableQueryLogging>

True</EnableSqlCommandLogging>

The following is an example of a SearchResults.dwp file that is configured so that the whole query string is logged to the IIS logs:

<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>

<WebPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v2&quot;>

<Assembly>Microsoft.SharePoint.Portal, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>

<TypeName>Microsoft.SharePoint.Portal.WebControls.SearchResults</TypeName>

<Title>SearchResults</Title>

True</EnableQueryLogging>

<EnableSqlCommandLogging>True</EnableSqlCommandLogging>

</WebPart>

</li></ul> </li> <li>Click Save on the File menu, and then quit Notepad.</li> <li>Click Go Back to Web Part Gallery on the Web Part Gallery: SearchResults.dwp page.</li> <li>Click Upload Web Part on the Web Part Gallery page.</li> <li>Click Browse. Locate and then click the SearchResults.dwp file that you exported, and then click Open.</li> <li>Click Save and Close on the Web Part Gallery: Upload Web Part page.</li></ol>

<div class="references_section">