Skip to content
aquesnel edited this page Jan 7, 2021 · 5 revisions

Logging functions

XRDP uses the following macros to emit log messages:

LOG : Logging macro for messages that are for a system administrator to configure and run XRDP on their machine.

LOG_DEVEL : Logging macro for messages that are for an XRDP developer to understand and debug XRDP code.

LOG_DEVEL_HEXDUMP : Logging macro for logging the contents of a byte array using a hex dump format.

Note: LOG, LOG_DEVEL, and LOG_DEVEL_HEXDUMP add the source code file name, line number, and function name as a prefix to the log message when XRDP is compiled with XRDP_DEBUG defined.

Note: LOG_DEVEL and LOG_DEVEL_HEXDUMP only emit log messages when XRDP is compiled with XRDP_DEBUG defined.

The logging macros above should be used instead of the log_message, log_message_with_location, and log_hexdump_with_location functions to ensure consistency of the logging features for all log messages.

For more details see the code of the logging macros

Log levels

Level Purpose
ERROR for describing non-recoverable error states in a request or method
WARNING for describing recoverable error states in a request or method
INFO for low verbosity and high level descriptions of normal operations
DEBUG for medium verbosity and low level descriptions of normal operations
TRACE for high verbosity and low level descriptions of normal operations (eg. method or wire tracing)

Logging outputs

XRDP supports logging to the following outputs:

  • console
  • syslog
  • log file

The logging outputs are configured independently for xrdp, xrdp-sesman, xrdp-chansrv in xrdp.ini and sesman.ini respectively, and documented in the xrdp.ini.5 and sesman.ini.5 man pages.

Log files

Process Name Log File Multiplicity
xrdp xrdp.log 1 per server
xrdp-sesman xrdp-sesman.log 1 per server
xrdp-chansrv xrdp-chansrv.%d.log 1 per display

The XRDP process forks upon receiving connections and runs as multiple process. Therefore the log file is opened using O_APPEND to allow the multiple processes to write to the same file without corrupting the log messages.

Clone this wiki locally