WLog is a configurable and flexible logging system used throughout winpr and FreeRDP.
The primary concept is to have a hierarchy of loggers that can be be configured independently.
TODO add more details and configuration examples.
The WLog are complementary the higher level always includes the lower ones. The level list below is top down. Top the highest level.
The format a logger prints in has the following possible options:
A maximum of 16 options can be used per format string.
An example that generally sets the WLOG_PREFIX for xfreerdp would look like:
WLOG_PREFIX="pid=%pid:tid=%tid:fn=%fn -" xfreerdp /v:xxx
WLog uses different appenders that define where the log output should be written to. If the application doesn't explicitly configure the appenders the above described variable WLOG_APPENDER can be used to choose one appender.
The following represents an overview about all appenders and their possible configuration values.
Write the log data into a binary format file.
Options: "outputfilename", value const char - file to write the data to "outputfilepath", value const char - location of the output file
The callback appender can be used from an application to get all log messages back the application. For example if an application wants to handle the log output itself.
The console appender writes to the console. Depending of the operating system the application runs on the output might be handled differently. For example on android log print would be used.
The file appender writes the textual output to a file.
This appender sends the logging messages to a pre-defined remote host via UDP.
If no target is set the default one 127.0.0.1:20000 is used. To receive the log messages one can use netcat. To receive the default target the following command could be used.
nc -u 127.0.0.1 -p 20000 -l
Use syslog for outputting the debug messages. No options available.
For outputting the log messages to journald this appender can be used. The available options are: