Linux Virtual Delivery Agent

Log collection

Logging mechanism overview

The following table presents an overview of the logging mechanism for the Linux VDA.

Logging module Log file name format Log file name example Logging scope Maximum single file size Rotation threshold (defaults) Configuration
HDX hdx.log[.n] hdx.log, hdx.log.1 Graphics, login, audio, keyboard, mouse 200 MiB 1 current, 2 old Configurable through the setlog utility
Jproxy jproxy.log[.n.log] jproxy.log, jproxy.log.1.log VDA registration, user authentication 20 MiB 1 current, 10 old Configurable through the setlog utility or /etc/xdl/log4j2.xml
VDA vda.YYYY-MM-DD.hh.mm.ss.log vda.2024-05-06.20.18.40.log VDA registration 10 MiB 1 current, 100 old Configurable through the setlog utility or /etc/xdl/brokeragent.conf

Note:

  • The first log file doesn’t have a number in its name, and subsequent files are numbered with “.n” where “n” represents the file number. For example, “hdx.log” is the first HDX log file and “hdx.log.1”is the second.
  • The maximum size of single log files is measured in Mebibytes (MiB).
  • A log file that is being generated and has not yet reached the maximum size for single files is referred to as a “current” log file. When a”current” log file reaches the maximum size for single files, it is rolled over and becomes an “old” log file.
  • The rotation threshold is configurable to limit the number of “old” log files that can be retained. The oldest log files will be deleted when the limit is reached.

Logging configuration

This section provides additional information about logging configuration, complementing the details outlined in the table above.

Logging enabled by default for the Linux VDA

The ctxlogd daemon and the setlog utility are included in the Linux VDA release package. By default, the ctxlogd daemon starts after you install and configure the Linux VDA. All the other services that are traced depend on the ctxlogd daemon. You can stop the ctxlogd daemon if you do not want to keep the Linux VDA traced.

Configure VDA logging through /etc/xdl/brokeragent.conf

Note:

If you’re looking to configure only log levels for VDA logging without delving into other logging parameters such as the maximum size for single log files, you can use the setlog utility described later in this article. Otherwise, use /etc/xdl/brokeragent.conf.

The /etc/xdl/brokeragent.conf file on the VDA is available for configuring VDA logging. For example:

The /etc/xdl/brokeragent.conf file

Note:

The maximum number of “old” VDA log files that can be retained is 100 by default. Adjust it as needed.

Configure Jproxy logging through /etc/xdl/log4j2.xml

Note:

If you’re looking to configure only log levels for Jproxy logging without delving into other logging parameters such as the maximum size for single log files, you can use the setlog utility described later in this article. Otherwise, use /etc/xdl/log4j2.xml.

The following is an example of configuring Jproxy logging through /etc/xdl/log4j2.xml, of which the SizeBasedTriggeringPolicy parameter specifies the maximum size for single Jproxy log files and the DefaultRollerStrategy parameter sets the total number of Jproxy log files that can be retained.

Configure Jproxy logging

Configure HDX logging through the setlog utility

The setlog utility resides under the /opt/Citrix/VDA/bin/ path. Only the root user has the privilege to run it. You can use the GUI or run commands to view and change your configuration options including values (log file path, single file size limit, and rotation threshold) and log levels. Run the following command for help with the setlog utility:

setlog help
<!--NeedCopy-->

Values

By default, HDX logs are saved under /var/log/xdl/hdx.log, the size limit of a single HDX log file is 200 MiB, and you can save up to two “old” HDX log files under /var/log/xdl/hdx.log.

To view all the current setlog values, run the following command:

setlog values

log_path (Log Output Path) = /var/log/xdl/hdx.log

log_size (Max Log Size (MiB)) = 200

log_count (Max Old Log Files) = 2
<!--NeedCopy-->

To view or set a single setlog value, run the following command:

setlog value <name> [<value>]
<!--NeedCopy-->

For example:

setlog value log_size 100
<!--NeedCopy-->

Levels

By default, log levels are set to info (case-insensitive).

When you encounter an issue requiring troubleshooting, we recommend that you set the log level to verbose in most scenarios. Afterwards, reproduce the issue and collect logs.

To set log levels (including Disabled, Inherited, Trace, Verbose, Information, Warnings, Errors, and Fatal Errors), run the following command:

setlog level <class> [<level>]
<!--NeedCopy-->
Log Level Command Parameter (Case-Insensitive)
Disabled none
Inherited inherit
Trace trace
Verbose verbose
Information info
Warnings warning
Errors error
Fatal Errors fatal

The <class> variable specifies a component of the Linux VDA. To cover all components, set it to all. For example:

setlog level all error
<!--NeedCopy-->

To view all supported classes or components, run the following command:

setlog levels
<!--NeedCopy-->

Restore Defaults

Revert all levels and values to the default settings:

setlog default
<!--NeedCopy-->

Important:

The ctxlogd service is configured using the /var/xdl/.ctxlog file, which only root users can create. Other users do not have write permission to this file. We recommend that root users not give write permission to other users. Failure to comply can cause the arbitrary or malicious configuration to ctxlogd, which can affect server performance and therefore the user experience.

Log collection

You can run the bash /opt/Citrix/VDA/bin/xdlcollect.sh command to collect logs. The xdlcollect Bash script used to collect logs is integrated into the Linux VDA software and located under /opt/Citrix/VDA/bin.

After the log collection completes, a compressed log file is generated in the same folder as the script. The xdlcollect Bash script can ask you whether to upload the compressed log file to Citrix Insight Services (CIS). If you agree, xdlcollect returns an upload_ID after the upload completes. The upload does not remove the compressed log file from your local machine. Other users can use the upload_ID to access the log file in CIS.

Troubleshooting

The ctxlogd daemon fails and you cannot restart the ctxlogd service when the /var/xdl/.ctxlog file is missing (for example, accidentally deleted).

/var/log/messages:

Apr 1 02:28:21 RH72 citrix-ctxlogd[17881]: Failed to open logging configuration file.

Apr 1 02:28:21 RH72 systemd: ctxlogd.service: main process exited, code=exited, status=1/FAILURE

Apr 1 02:28:21 RH72 systemd: Unit ctxlogd.service entered failed state.

Apr 1 02:28:21 RH72 systemd: ctxlogd.service failed.
<!--NeedCopy-->

To solve this issue, run setlog as a root user to recreate the /var/xdl/.ctxlog file. Then restart the ctxlogd service on which other services depend.

Log collection