• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

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 KreaTV support 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 an IP-STB for logging (this is done when building the boot image).

Bootimages included in the KreaTV SDK have logging enabled by default for 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. Usage:

# logclient Usage: logclient [-h] [-t] [-c WHEN] [-f FILE] [-l LEVELS] <HOST> [PORT]

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".

logclient -l all -f log1.log 192.168.5.200

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.

logserver

In some network environment, which NAT is applied to, logclient is no longer available. A special tool is used to receive the logs sent over the network, this tool is called "logserver", which is available only for Linux for now. Usage:

# logserver Usage: ./logserver -d [dir] -p [port]

The following command will receive logs from the IP-STB with port 3008, and save the log to /opt/log/.

./logserver -d /opt/log/ -p 3008

The logs will be saved to disk, a directory will be created named by the box serial NO. If no directory is specified, the log will save to the current directory. If no port is specified, the log will be received on the default port which is 3000. A log file will be saved in the directory named by the current date. Old logs are not overwritten, they are appended to the same date file. This script will create one log file per day.

wxlogclient

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

wxlogclient

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

The Linux version requires wxPython version 2.8.8.

Enabling logging in the STB

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.

In some cases, log lines may be lost as the TCP log server needs to close before entering passive standby, and to restart when leaving passive standby. During this time the log buffer may overflow and some lines of logging may be lost in extreme cases. The risk of this occurring can be reduced by increasing kreatv-tool-logging:buffer_size if necessary for debugging. A buffer size of 10000 can hold approximately 100 log lines.

Sending log messages from applications

JavaScript portals can write to the log by using the console.log() function call:


console.log("Hello World!");

Log messages logged this way can be prefixed with one of the strings below to indicate log level.

StringLog level
<D>Debug
<N>Note
<W>Warning
<E>Error
<F>Fatal

5.0.1

Copyright (c) 2016 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.