How to Enable Persistent CDF Tracing in XenDesktop 7.6

How to Enable Persistent CDF Tracing in XenDesktop 7.6

book

Article ID: CTX200341

calendar_today

Updated On:

Description

This article describes how to enable persistent CDF tracing in XenDesktop 7.6.

Requirements

  • Any desktop or server version of Windows from XP onward, with PowerShell 2.0 or later installed.
  • At least one XenDesktop component (any version) installed on the target machine.
  • XenDesktop 7.5 installation media needed to access the script.

Instructions

To prevent the need to set up and configure CDF tracing once an issue has been identified in a XenDesktop 7.6 environment, XenDesktop 7.6 has an option to enable persistent CDF tracing for all modules in advance using a configurable PowerShell script.

The New-XdLogTrace.ps1 script uses the built in Windows tool logman.exe to manage the collection of trace messages emitted by Citrix components (CDF traces) to a cyclic buffer with a specified maximum buffer size (100 megabytes by default). All CDF trace messages are captured by default, with the exception of some specified CDF module name patterns. See blacklist parameter. See:

Simple Usage

To enable persistent CDF tracing, locate and run the following PowerShell script New-XdlogTrace.ps1 located under the following directory on XenDesktop 7.6 installation media:

Support\Tools\Scripts\ New-XdlogTrace.ps1

Note: Prior to executing the New-XdlogTrace.ps1 script, check the execution policy in PowerShell. To check the current execution policy, run Get-ExecutionPolicy. If the output displays Restricted, change it by running Set-ExecutionPolicy Unrestricted to be able to execute the New-XdlogTrace.ps1.

  1. Launch PowerShell from Desktop Studio.

  2. Change path to the folder where the script is located, for example: D:\Support\Tools\Scripts.

  3. Type Get-ExecutionPolicy.

  4. If the result is Restricted:

    1. Type Set-ExecutionPolicy Unrestricted.
    2. Type y.
  5. To run the script, type .\New-XDLogTrace.ps1.
    Optionally specify parameters – see following Step 6.

  6. To optionally change the script execution policy back:

    1. Type Set-ExecutionPolicy Restricted.
    2. Type y.

This sets up a persistent CDF trace log for the default set of modules. The log file will be located at C:\logs\XdLogs.etl by default. If this location is unavailable, specify an alternative path using the fileName parameter (refer to the following screen shot).

When persistent CDF tracing is enabled and running, enable or disable and view the status using Performance Monitor (perfmon.exe). Refer to the following screen shot (as seen in Windows Server 2008):

User-added image

User-added image

Advanced Usage

You can view the full in-built help for the script by running Get-Help .\New-XdLogTrace.ps1 -full.

Parameters and default values:
  • fileName = 'C:\logs\XdLogs.etl'
    The name and path of the circular buffer in which to collect the trace data. The directory will be created if it does exist. If the file already exists, it will be overwritten. Note, however, that if this file is currently in use by an existing log job other than the one specified with -Name, the command will fail.

  • logLevel = 5
    Defines what verbose level is the threshold to be used for collecting or discarding the tracing messages. Traces generated at a log level higher than this are discarded, whereas traces at or below this level are collected.

  • maxSizeMb = 100
    The maximum size, in megabytes, allowed for the circular buffer file.

  • name = 'XenDesktopLog'
    The name of the persistent trace job that will be set up to capture the traces. This name will appear in Windows control panels etc.

  • whitelist = @('*' )
    A list of patterns to match against the names of CDF modules. Traces from CDF modules whose names match any of these patterns will be included in the trace collection unless the module is excluded via the blacklist.

  • blacklist = @('*ServiceDAL','*ServiceFiltering','*ServiceTracking' )
    A list of patterns to match against the names of CDF modules. Traces from CDF modules whose names match any of these patterns will be excluded in the trace collection. Wildcards may be used.

  • ctlLocations = @('C:\Program Files (x86)\Citrix\ICA Client\IcaClientTraceProviders.ctl')
    A list of locations for CTL files, which specify additional traceable Citrix not listed in the registry. The default CTL location allows Receiver modules to be captured, which are not available normally. Note the “x86” path in the default – this will need to be overridden on a 32-bit system.

Optional Switches

  • preserveOldLogs
    Causes logs collected from any currently set up trace capture to be preserved, rather than the default action of being deleted.

  • stop
    Causes the named log collection to be stopped and the persistent job to be deleted. No further processing or log job creation will take place.

  • help
    Causes the help for the script to be displayed.

  • showParams
    Causes the script to output the values that it is using, which may be defaults or may have been overridden.

  • useCtlOnly
    A switch that causes modules to only be loaded from the CTL files specified using -ctlLocations, without looking in the registry.

Issue/Introduction

This article describes how to enable persistent CDF tracing in XenDesktop 7.6.

Additional Information

CTX111961 ‑ CDFControl

To enable persistent CDF Tracing in XenDesktop 5 to XenDesktop 7.5, see CTX127476 - How to Enable Persistent CDF Tracing in XenDesktop 5.