How to Trace Requests for a Specific URL or Set of URLs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

If you are actively troubleshooting a problem and you know the URL where the problem exists, you can trace that specific URL. If you do not know which URL is causing the problem, but you suspect it may be an Active Server Page (ASP) or Microsoft ASP.NET page, you can trace a set of URLs.

Request-based tracing for a specific URL or set of URLs uses the following commands or switches:

logman start

Starts the trace session using Logman.exe as the controller.

logman stop

Stops the trace session.

session name

Any name you want to give this trace session.

-pf provider file name

Identifies the name of the provider file. This can also be a path to the file. For more information, see How to Create a Provider File for Request-Based Tracing.

-ets

Tells Logman.exe to start the trace session immediately.

To trace requests for a specific URL

  1. Configure the TraceUriPrefix Metabase Property for the URL you want to trace.

    1. Open a command prompt and navigate to the %windir%\Inetpub\AdminScripts directory.

    2. Type **adsutil.vbs set w3svc/n/TraceUriPrefix=**path to URL and press ENTER. N is the number of the site as it is listed in the metabase, e.g. w3svc/1 is the default Web site (by default). Path to URL is the physical path to the file you want to trace, e.g. %windir%\Inetpub\wwwroot\asp\default.asp

  2. Set the UseUrlFilter flag.

    1. Create a new provider file or open an existing provider file. See How to Create a Provider File for Request-Based Tracing.

    2. Enter one of the following items in your provider file:

      "IIS: WWW Server" UseUrlFilter 5

      The UseUrlFilter flag enables tracing for the URL specified in the TraceUriPrefix metabase property.

      -or-

      "IIS: WWW Server" 0xFFFFFFFE 5

      The 0xFFFFFFFE flag enables all the WWW server tracing flags, including the UseUrlFilter flag.

  3. Save and close the provider file.

  4. From a command prompt, type logman start session name -pf provider file name -ets and press ENTER.

    For example: logman start AllAspTrace -pf AllAspUrls -ets

  5. Event Tracing for Windows prints to the screen details about the trace session you just started, including the name of the session, the file name where the trace data will be collected (session name.etl by default), the providers listed in the provider file, and whether or not the command was successful.

  6. Allow the trace session to run until you have reproduced the problem or until your sites have processed enough requests to produce a manageable data set.

  7. From the command prompt, type logman stop session name -ets and press ENTER.

    To view the trace data, see How to Process and View Trace Log Files.

To trace requests for a set of URLs

  1. Configure the TraceUriPrefix Metabase Property for the URLs you want to trace.

    1. Open a command prompt and navigate to the %windir%\Inetpub\AdminScripts directory.

    2. Type **adsutil.vbs set w3svc/n/TraceUriPrefix=**path to URL*extension and press ENTER. N is the number of the site as it is listed in the metabase, e.g. w3svc/1 is the default Web site (by default). Path to URL*extension is the physical path to the group of files you want to trace, e.g. %windir%\Inetpub\wwwroot\asp\*.asp or %windir%\Inetpub\wwroot\aspnet\*.aspx

  2. Set the UseUrlFilter flag.

    1. Create a new provider file or open an existing provider file. See How to Create a Provider File for Request-Based Tracing.

    2. Enter the ASP provider, if you are going to trace a group of .asp files, for example: "IIS: Active Server Pages (ASP)" 0 5

    3. Type one of the following items in your provider file:

      "IIS: WWW Server" UseUrlFilter 5

      The UseUrlFilter flag enables tracing for the URL specified in the TraceUriPrefix metabase property.

      -or-

      "IIS: WWW Server" 0xFFFFFFFE 5

      The 0xFFFFFFFE flag enables all the WWW server tracing flags, including the UseUrlFilter flag.

  3. Save and close the provider file.

  4. From a command prompt, type logman start session name -pf provider file name -ets and press ENTER.

    For example: logman start AllAspTrace -pf AllAspUrls -ets

  5. Event Tracing for Windows prints to the screen details about the trace session you just started, including the name of the session, the file name where the trace data will be collected (session name.etl by default), the providers listed in the provider file, and whether or not the command was successful.

  6. Allow the trace session to run until you have reproduced the problem or until your sites have processed enough requests to produce a manageable data set.

  7. From the command prompt, type logman stop session name -ets and press ENTER.

    To view the trace data, see How to Process and View Trace Log Files.