STB Logging tools

Logging is an essential troubleshooting tool when things are not working as expected. It is possible to connect to a log server that runs on the IP-STB to receive logs that are collected from all running processes. This log can for example be sent to Motorola for further analysis.

If logging is enabled in the running bootimage, it's possible to connect to a customers IP-STB if he is reporting problems. The end user will not notice that the IP-STB is being logged. It does not consume extra CPU or memory on the IP-STB to enable logging. The logs are sent as TCP traffic on a specific port (19999 default). It is possible to restrict the IP numbers that are allowed to connect to a IP-STB for logging (this is done when building the boot image).

Note! Bootimages included in the KreaTV Starter Kit have logging enabled by default to all hosts.

logclient

A special client application is used to receive the logs sent over the network, this application is called "logclient". The logclient is available for Linux and Windows. The Linux version is included in the SDK and Starter Kit packages. Usage:

[/root]# logclient
Usage: logclient [-h] [-f filename]  

The following command line will receive logs from the IP-STB with IP number 192.168.5.200 and save the output to a file "log1.log".

[/root]# logclient -f log1.log 192.168.5.200 19999

The logs will both be printed on screen and saved to disk using the specified file name. If no filename is specified the logs will only be printed on the screen. Old logs are not overwritten, they are appended to. Note that very long log files are difficult to read.

wxlogclient

A graphical log client is also available for Linux and Windows. The Linux version is included in the SDK and Starter Kit packages. Usage:

# wxlogclient

wxlogclient can (in addition to showing the pure log text messages) also display graphs of the memory and CPU usage etc.

Note! The Linux version requires wxPython version 2.8.8.

Enabling logging in the STB

Note! The following information only applies for users of the SDK.

Logging is enabled by including the "kreatv-tool-logging" package with the appropriate parameters when building a boot image using the SDK. Example:

kreatv-tool-logging:allowedip=192.168.4.100,port=19999

This will enable logging and allow a client running on the machine with IP number 192.168.4.100 to connect to port 19999 and receive logs. It is possible to add several allowed IPs but it is only possible for one client at a time to connect to the server.

By default any host is allowed to connect to the log server but it is wise to specify allowed IP numbers, specially in a production network. The default port number is 19999 and normally there is no need to change it.

Sending log messages from applications

Sending Logs from Applications

Note! The following information only applies for users of the SDK.

Strings sent to "standard error" by applications are collected by the log server and sent to the connected client. You must end the line with a newline character ('\n'). The following examples are equivalent:

std::cerr << "This is a log message" << std::endl;
fprintf(stderr,"This is a log message\n");