When customers encounter issues and the default logs do not provide sufficient data for our engineers to diagnose, we need to enable trace logging to get more details. This article describes how to enable trace logging for the Linux VDA.
The Linux VDA has two main services - ctxvda and ctxhdx. Different preconditions and steps are required to enable trace logging for the two services.
Instructions
Follow the steps below to enable trace logging for ctxvda:
- Find the /etc/xdl/ctx-vda.conf file. The file is generated after you configure the Linux VDA by ctxsetup.sh.
- Uncomment the line and change the following setting.
From
#Log4jConfig=”/etc/xdl/log4j.xml”
To
Log4jConfig=”/etc/xdl/log4j.xml”
- Open the /etc/xdl/log4j.xml file, find the following content, change the level value to trace, and save the file.
<root>
<level value=”info”/>
<appender-ref ref=”file”/>
<appender-ref ref=”syslog”/>
</root>
- Restart the ctxvda service.
sudo service ctxvda restart
Trace level logs will be found in
/var/log/xdl/vda.log.
Each log level defines the minimum rank of messages to log:
-
ALL - The lowest possible rank. Intended to log all.
-
TRACE - Designates finer-grained informational events than the DEBUG level.
-
DEBUG - Designates fine-grained informational events that are most useful to debug an application.
-
INFO - Designates informational messages that highlight the progress of an application at coarse-grained level.
-
WARN - Designates potentially harmful situations.
-
ERROR - Designates error events that might still allow an application to continue to run.
-
FATAL - Designates very severe error events that will presumably cause an application to abort.
-
OFF - The highest possible rank. Intended to .
The Linux VDA has been using a new log system since version 1.2. Log messages are sent directly to syslog and trace messages are sent to a new optional component - the ctxLog daemon (ctxlogd).
The setdbg utility is replaced with the new setlog utility, which offers more intuitive control over trace output.
The setlog utility and ctxlog daemon are included in the trace package. For the relevant trace and symbol packages, contact Citrix Escalation engineers.
Follow the steps below to enable trace logging for ctxhdx and all other services:
- Install the proper version of the trace and symbol packages.
- Enable the ctxlog daemon.
sudo service ctxlogd start
- Restart corresponding services to enable the trace log for each services.
sudo service ctxhdx restart
sudo service ctxcdm restart // For CDM
sudo service ctxpolicyd restart //For policy
sudo service ctxusbsd restart //For usb
- Change log levels using the setlog utility.
Logs will be found in
/var/log/xdl/hdx.log.
Trace logging is configured using the setlog utility, which is packaged alongside the ctxlog daemon.
Log classes are now organized into a hierarchy, allowing settings to be inherited. You can set each log class to allow a minimum message priority, to be disabled entirely, or to inherit settings from its parent. The flags to control what metadata is printed with trace messages have returned.
The setlog utility allows you to configure the path that trace output will be written to and to configure log rollover based on a threshold file size. It also now has basic command line options so that you can control trace flags and levels over SSH or in any other circumstances where a graphical environment is not available. For more information, type
setlog help.
For the log classes required, contact Citrix technical support.