This article describes how to capture a Common Diagnostic Facility (CDF) trace during system startup using registry settings.
Create a registry value under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Tracing:
Value Name: PersistentTraceLogPath
Value Type: REG_SZ
Value: Type the log path here
Note: The value for the log path must be a file path, such as C:\CitrixLogFile. Do not type the name of the log file.
The trace session name and trace log file name is always CDF_PersistSession and CDF_PersistSession.etl, respectively. The log file is stored in the path specified by the registry settings. The trace path must be an existing path, you cannot create it at runtime.
To enable the trace providers, modify the provider registry values under:
KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Tracing\Modules\<Providers>:
Value Name: “Enabled”
Value Type: REG_DWORD
Value: Set 1, to enable tracing
Set Flags and Level in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Tracing\Modules\<Providers>:
Value Type: REG_DWORD
Value: Set the required trace flags, supplied by Citrix Technical Support.
The maximum flag level is hex FFFFFF.
Value Name: “Level”
Value Type: REG_DWORD
Value: Set the required trace level, supplied by Citrix Technical Support.
The highest level is decimal 16.
In addition to these steps you may have to modify the following registry value to LocalSystem:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CdfSvc\
Value Name: ObjectName
Value Type: REG_SZ
Value: “LocalSystem”
Note: To correctly capture traces during startup, some service and driver components might need to depend on the CdfSvc service.
The DependOnService registry value is located in: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<ServiceName>
Value Name: “DependOnService”
Value Type: REG_MULTI_SZ
Value: Append CdfSvc to the list
Restart cdfsvc.exe or the server.
When you first open the trace file, it might appear empty. This is because the traces are cached in memory and are rarely written to the log file. To flush out the traces from memory, it is necessary to stop the CdfSvc service. If the service does not stop because of the dependency chain, restart the server and open the backed up copy of the trace log file. The backed up log file has a filename CDF_PersistSession.etl.backup.
The persistent CDF trace session configures the trace to use EVENT_TRACE_FILE_MODE_CIRCULAR by default.
The REG_DWORD value “LogFileLogMode” under HKLM\System\CurrentControlSet\Control\Citrix\Tracing can specify any of the following values amongst others:
0x00000002 EVENT_TRACE_FILE_MODE_CIRCULAR (default)
0x00000001 EVENT_TRACE_FILE_MODE_SEQUENTIAL