+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Accessing log files

Logs are created for each container instance. We can access log files using the IBM® Container Cloud Service REST API, by using cf ic commands, or by using the Bluemix® logmet console.


IBM Container Cloud Service REST API

For any container instance, the docker.log and /var/log/rsyslog/syslog can be viewed using the Bluemix logmet service (https://logmet.ng.bluemix.net/kibana/). The log activities can be seen using the Kibana dashboard of the same.

IBM Containers CLI commands (cf ic exec) can be used to gain access to running container instances. Alternatively, we can obtain container log files through Secure Shell (SSH).


Enabling SSH

To enable SSH, copy the SSH public key to the package_root/[mfpf-server or mfpf-analytics]/usr/ssh folder before you run the prepareserver.sh or the prepareanalytics.sh scripts. This builds the image with SSH enabled. Any container created from that particular image will have the SSH enabled.

If SSH is not enabled as part of the image customization, we can enable it for the container using the SSH_ENABLE and SSH_KEY arguments when executing the startserver.sh or startanalytics.sh scripts. We can optionally customize the related script .properties files to include the key content.

The container logs endpoint gets stdout logs with the given ID of the container instance.

Example: GET /containers/{container_id}/logs

Parent topic: Log and trace collection