Logging is pretty limited with serverless applications as there are no VMs, no OS, and no middleware packages. But we have to make the best use of what logging functionalities we do have in order to efficiently debug and resolve any issues we might have with OpenWhisk actions. The bright side is that we still have access to output logging for actions. So the only thing we have to do is it to push the files into Elasticsearch and index them for better use. We will be look at how to do this in this section.
We will be setting up ELK with Docker locally and pushing the OpenWhisk action logs into ELK. The OpenWhisk cloud has out-of-the-box ELK configuration, so we can view the aggregated logs on the portal itself. To do this, we need to log into the Bluemix portal. Go through the following steps:
- Log into the Bluemix portal at https://console.bluemix.net/.
- Click on the Functions link; this will take you to the functions/actions portal.
- In the portal, click on Logs. We will be taken to a page with a Kibana dashboard. There, we can search for the required logs. More details for viewing these logs can be followed at https://console.bluemix.net/docs/openwhisk/openwhisk_logs.html#viewing-activation-logs-in-the-ibm-cloud.
However, it is quite expensive to maintain logs on the portal, and it is more difficult and costly to retain them for longer periods, so to save some infrastructure cost, we can pull the logs locally and retain them for a long period, and at much cheaper cost. Next, we will see how we can set up ELK locally and pull the logs.