Log and trace collection

Syslog and Liberty log files are generated for MobileFirst Server and MobileFirst Operational Analytics containers.

To persist the log files, you must enable volume. Syslogs are persisted in the /var/log/rsyslog folder and Liberty logs are persisted in the /opt/ibm/wlp/usr/servers/worklight/logs folder.

Liberty logs get created at the trace specification level info by default (collecting general information that outlines task progress), however, you can change the logging level by manually adding a code override or by injecting code using a script file.

Enabling SSH to access container logs, enabling volume to persist log files, changing the trace level, and other logging-related options must be done during container creation when running one of the following start-up scripts:

Volume

When you enable the volume configuration option for a container, volumes persist the container logs regardless of whether the container is active or deleted. Volume for MobileFirst Server and MobileFirst Operational Analytics containers is not enabled by default.

You can enable volume when running one of the start-up scripts mentioned above.

Examples of how to enable volume using a start-up script for regular, silent, and interactive command modes:
  • Command-line mode - If you are running scripts from the command line, pass-in the value Y for the [-v|--volume] command-line argument.
  • Silent mode - If you are running scripts in silent mode, set the ENABLE_VOLUME property to Y in the related properties file for the script (such as args/startserver.properties or args/startservergroup.properties).
  • Interactive mode - If you are running scripts in interactive mode, specify Y at the Enable mounting volume for the MobileFirst container logs prompt.

You can still view logs in the Bluemix dashboard using the Logmet service regardless of whether volume and SSH were enabled during container creation.

Monitoring

IBM Containers for Bluemix provides some built-in logging and monitoring capabilites around container CPU, memory, and the interfacing networks. Both container logs and server or runtime logs can be viewed from a Bluemix logmet console by means of the Kibana visualization tool. Active monitoring can be done from a Bluemix logmet console with Grafana, an open source metrics dashboard and graph editor.