从 CVAD 核心组件上传 AOT 日志

Last published : Nov 13, 2026
如果您已在 HTTPS 模式下配置日志服务器 https://<LogServerFQDN>:port,请确保必要的证书已正确安装并在您的系统上受信任。
  1. 从 Storefront™ 上传 AOT 日志
    #Enable uploading in HTTP

    Set-STFDiagnosticsLogServer -Server LogServerFQDN:8080

    #Or to use HTTPS

    Set-STFDiagnosticsLogServer -Server https://LogServerFQDN:8443

    #Disable

    Clear-STFDiagnosticsLogServer

    #The configuration will take effect in one hour. To apply the changes immediately, restart the Citrix Telemetry Service.
  2. 从 DDC 上传 AOT 日志:
    #Enable uploadng in HTTP
    Set-ConfigSite -LogServerEnabled $true -LogServerName LogServerFQDN -LogServerPort 8080

    #Or enable HTTPS
    Set-ConfigSite -LogServerEnabled $true -LogServerName https://LogServerFQDN -LogServerPort 8443
    #Disable HTTP
    Set-ConfigSite -LogServerEnabled $false -LogServerName LogServerFQDN -LogServerPort 8080
    #Disable HTTPS
    Set-ConfigSite -LogServerEnabled $false -LogServerName https://LogServerFQDN -LogServerPort 8443
  3. 在 Windows VDA 上启用 AOT:
在安装 DDC 的计算机上,运行以下命令,之后您需要重新启动 Citrix Desktop Service 以使其立即生效。
```bash
#Initiate, run following commands in DDC powershell
$configSlot = New-BrokerConfigurationSlot -Name VdaAotTracing -Description VdaAotTracing -SettingsGroup G=Telemetry


#If using HTTPS, parameter of -Endpoint should be "https://logserverFQDN:8443"
$policy = New-BrokerLogServerAddress -Enabled $true -Endpoint "logserverFQDN:8080"
$mc = New-BrokerMachineConfiguration -ConfigurationSlotUid $configSlot.Uid -LeafName VdaAotTracing -Policy $policy


# Using the real DeliverygroupName of your VDA.
$dg = Get-BrokerDesktopGroup -Name "DeliverygroupName"  
Add-BrokerMachineConfiguration -InputObject $mc -DesktopGroup $dg


#Restart Citrix Desktop Service in your VDA to make it take effect immediately.
```
当日志服务器地址或端口更改时更新:
```bash
#Update, run following commands in DDC powershell
#If using HTTPS, parameter of -Endpoint should be "https://NewLogServerFQDN:8443"


$policy = New-BrokerLogServerAddress -Enabled $true -Endpoint "NewLogServerFQDN:8443"
Set-BrokerMachineConfiguration -Name "VdaAotTracing\VdaAotTracing" -Policy $policy
$mc=Get-BrokerMachineConfiguration -Name "VdaAotTracing\VdaAotTracing"

# Using the real DeliverygroupName of your VDA.
$dg = Get-BrokerDesktopGroup -Name "DeliverygroupName"
Add-BrokerMachineConfiguration -InputObject $mc -DesktopGroup $dg
#Restart Citrix Desktop Service in your VDA to make it take effect immediately.
```
如何禁用:
```bash
#Disable, run following commands in DDC powershell


#If using HTTPS, parameter of -Endpoint should be "https://LogServerFQDn:8443"
$policy = New-BrokerLogServerAddress -Enabled $false -Endpoint "LogServerFQDN:8080"
Set-BrokerMachineConfiguration -Name "VdaAotTracing\VdaAotTracing" -Policy $policy
$mc=Get-BrokerMachineConfiguration -Name "VdaAotTracing\VdaAotTracing"

# Using the real DeliverygroupName of your VDA.
$dg = Get-BrokerDesktopGroup -Name "DeliverygroupName"
Add-BrokerMachineConfiguration -InputObject $mc -DesktopGroup $dg

#Restart Citrix Desktop Service in your VDA to make it take effect immediately.

```
  1. 直接在 WindowsVDA 上启用 AOT:
直接在您要上传 AOT 的计算机 (WindowsVDA) 上运行该命令。这仅在应用该命令的计算机上生效。
```bash
# Enable AOT uploading for Windows VDA
#If using HTTPS, parameter of -AotDataStoreEndpoint should be "https://LogServerFQDN:8443"

Enable-CitrixAOTUpload -AotDataStoreEndpoint LogServerFQDN:8443 -Role WVDA

# Disable AOT uploading
Disable-CitrixAOTUpload
```

查看和使用 AOT 日志

通过日志服务器访问日志

为了确保日志安全,您需要一个 下载前的 AuthKey 才能下载它们。操作步骤如下:
  1. 获取您的 AuthKey – 使用您自己的角色名称/名称来生成它。
  2. 本地运行 – 脚本只能在安装了 Docker 容器的计算机上运行。
  3. Windows 用户 – 使用 GetAuthKey.bat 脚本而不是 shell 脚本。
  4. 下载日志 – 经过身份验证后,您可以安全地检索日志。
    For Linux
    ./GetAuthKey.sh role-name
    {"key":"ebac9b7726cb4be597c92c6769134d25","role":"role-name","status":"DONE"}

    For Windows
    GetAuthKey.bat role-name
    {"key":"ebac9b7726cb4be597c92c6769134d25","role":"role-name","status":"DONE"}

    #Save the key: ebac9b7726cb4be597c92c6769134d25 by yourself. It's the only way to get the key.
列出已将 AOT 日志发送到日志服务器的计算机名称:
```bash
#The parameter is the key get from GetAuthKey.sh
For linux:
./ListMachines.sh ebac9b7726cb4be597c92c6769134d25
{"machines":["MachineName"]}
#Empty machines means that there has no log

For Windows:
ListMachines.bat ebac9b7726cb4be597c92c6769134d25
{"machines":["MachineName"]}
#Empty machines means that there has no log
```
按机器名称和时间范围下载日志。时间采用 UTC 格式。
```bash
#Usage: ./DownloadLogsByTime.sh [AuthKey] [MachineName] [StartTime] [EndTime] [OutputFile]
#Example:

For Linux
./DownloadLogsByTime.sh ebac9b7726cb4be597c92c6769134d25 MachineName 2025-01-01T00:00:00Z 2025-01-02T00:00:00Z logs.csv

For Windows
DownloadLogsByTime.bat ebac9b7726cb4be597c92c6769134d25 MachineName 2025-01-01T00:00:00Z 2025-01-02T00:00:00Z logs.csv
```
按关键字/过滤器下载日志。时间采用 UTC 格式:
注意:
  • 关键字可以是单个词或词的组合。
  • 关键字可以匹配日志消息中的任何位置。
  • 事务 ID 也可以用作关键字。
```bash
#Usage: ./DownloadLogsByWords.sh [AuthKey] [StartTime] [EndTime] [SearchWords] [OutputFile]

#Example:
For Linux:
./DownloadLogsByWords.sh authkey 2025-01-01T00:00:00.000Z 2025-12-31T23:59:59.999Z "session launch" logs.csv

For Windows:
DownloadLogsByWords.bat authkey 2025-01-01T00:00:00.000Z 2025-12-31T23:59:59.999Z "failed vda" logs.csv
```