How to enable query logging in SharePoint Portal Server 2003 (890614)



The information in this article 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:

    <EnableQueryLogging>True</EnableQueryLogging>

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

    <EnableQueryLogging>True</EnableQueryLogging>
    <EnableSqlCommandLogging>True</EnableSqlCommandLogging>

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

      <EnableQueryLogging>True</EnableQueryLogging>

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

      <EnableQueryLogging>True</EnableQueryLogging>
      <EnableSqlCommandLogging>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="1.0" encoding="utf-8"?>
      
      <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
      
                <Assembly>Microsoft.SharePoint.Portal, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
      
                <TypeName>Microsoft.SharePoint.Portal.WebControls.SearchResults</TypeName>
      
                <Title>SearchResults</Title>
      
                  <EnableQueryLogging>True</EnableQueryLogging>
      
                  <EnableSqlCommandLogging>True</EnableSqlCommandLogging>
      
      </WebPart>
      
      

  11. Click Save on the File menu, and then quit Notepad.
  12. Click Go Back to Web Part Gallery on the Web Part Gallery: SearchResults.dwp page.
  13. Click Upload Web Part on the Web Part Gallery page.
  14. Click Browse. Locate and then click the SearchResults.dwp file that you exported, and then click Open.
  15. Click Save and Close on the Web Part Gallery: Upload Web Part page.

REFERENCES

For more information about how to work with Web Parts, see the "Working with Web Part Pages" topic in the Working with Windows SharePoint Services section of SharePoint Portal Server 2003 Help.

For information about how to create a Web Part to display search data from SharePoint Portal Server 2003, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:12/30/2004
Keywords:kb3rdparty kbConfig kbhowto kbinfo KB890614 kbAudITPRO