14.3.  Configuring Logging on ThinLinc servers

In this section we will describe how ThinLinc logs activities on the server, and how the logging can be configured.

Logs are written by each individual session and by the following ThinLinc server components.

14.3.1.  ThinLinc server components

Logging is configured by editing parameters in Hiveconf. Each component that uses the logging system has a Hiveconf folder named logging . In this folder and its subfolder, the logging system is configured.

14.3.1.1.  Log destinations

Logs can be written either to file on the local disk, to syslog or both.

14.3.1.1.1.  Writing Logs to File

The file name for the log file written to local disk is configured by editing the parameter logfile under the logging folder. To turn off logging to file, set the parameter log_to_file to 0. Note that the log file will still be created. If abnormal situations occur because of programming errors, data may appear in the file.

14.3.1.1.2.  Writing Logs to Syslog

For large installations, using a central loghost might be very convenient. ThinLinc supports writing logs to syslog, which makes it possible to collect all logs in one place.

By setting the parameter log_to_syslog under the logging folder to 1, logs will be written to syslog. Specify the syslog facility in the parameter syslog_facility . The default behaviour is not to log to syslog.

If the parameter syslog_host is set, logs will be sent via UDP to the syslog daemon on the host specified. If not, logs will be sent to syslog by writing to the socket specified in syslog_socket . The latter is the default.

14.3.1.2.  Subloggers

Each program doing logging uses a number of sub loggers. Sub loggers are a way to distinguish different types of information written by the program. For example, the VSM server uses the subloggers license, session and shadow for logging license-related messages, information about sessions and information about shadowing repectively. Every sublogger can be configured to use a different log level. This allows the system administrator to, for example, increase the information about new sessions without increasing the overall loglevel, easing debugging of specific problems.

14.3.1.3.  Log levels

The amount of logging can be configured using log levels. The log levels available are:

Table 14.1.  Log Levels

Log LevelExplanation
ERRORUnrecoverable Errors
WARNINGWarnings - something went wrong, but ThinLinc can recover.
INFOMessages that are useful in daily maintenance.
DEBUGMessages that can be of use for system administrators when debugging problems.
DEBUG2Messages useful to trained ThinLinc personel when doing advanced debugging.

The log level configured can be seen as a barrier. If the log level is set to for example INFO, log messages with a level of INFO or higher are let through. If the log level instead is set to DEBUG2, all log messages are let through, since all log levels are higher than DEBUG2.

There is one default loglevel, and one loglevel per sublogger defined. If the log level for a sub level is set to a lower value than the default loglevel, more information will be written by that specific sublogger.

The default loglevel is configured in the logging/defaultlevel parameter. Each sublogger's level can then be configured by setting the parameters under the logging/levels folder.

14.3.1.4.  Summary

The default logging configuration is summarized in Table 14.2.

Table 14.2.  Default Log Behaviour

ComponentDefault BehaviourLog Configuration Hive Folder
VSM serverLog to /var/log/vsmserver.log/vsmserver/logging
VSM agentLog to /var/log/vsmagent.log/vsmagent/logging
Web Administration InterfaceLog to /var/log/tlwebadm.log/tlwebadm/logging
Web Access (HTML5 client)Log to /var/log/tlwebaccess.log/webaccess/logging

14.3.2.  Per-Session Logging

Each Session writes what is written to standard output and standard error output to a file named xinit.log which is located in the session directory for a specific session. For example, the log for the last session of the user pelle is located in /var/opt/thinlinc/sessions/pelle/last/. This log contains for example output written by software run in the session, but it also has some output from ThinLinc software that is run by the user.