Skip to main content

Overview

WLog is a configurable and flexible logging system used throughout WinPR and FreeRDP. The primary concept is a hierarchy of loggers that can be configured independently. Each logger is identified by a dotted name (e.g., core.channel, com.freerdp.client.x11) and inherits settings from its parent unless overridden. Configuration is done entirely through environment variables — no source changes are required.

Log levels

Levels are cumulative: setting a level includes all levels below it in the hierarchy.

Environment variables

Core variables

File appender variables

Journald appender variable

UDP appender variable


Format specifiers

The WLOG_PREFIX variable controls what appears before each log message. Specifiers are prefixed with %.
A maximum of 16 specifiers can be used in a single format string.

Example prefix


Appenders

An appender defines where log output is written. Select one with WLOG_APPENDER.
Writes to the console. On Android, log_print is used instead.outputstream option values:
  • stdout — write everything to stdout
  • stderr — write everything to stderr
  • default — errors and fatal messages go to stderr; everything else to stdout
  • debug — use debug output (Windows only; behaves like default on other platforms)
Writes textual log output to a file.
Writes log data in a binary format file.
Sends log messages to a remote host over UDP. The default target is 127.0.0.1:20000.
Receive messages with netcat in a second terminal:
Outputs log messages to syslog. No additional options are available.
Syslog support is optional and depends on build-time configuration.
Outputs log messages to the systemd journal.
Read the journal:
Journald support is optional. It requires building with -DWITH_LIBSYSTEMD=ON.

Filtering specific modules

Use WLOG_FILTER to restrict output to particular loggers and levels. The format is a comma-separated list of <logger>:<level> pairs.
Only loggers matching the filter are printed; all others are suppressed regardless of WLOG_LEVEL.

Common recipes