To debug your code service, ClearBlade provides as simple, but flexible logging facility. There are three steps involved:

When you create your code service, you can enable logging for that code service by selecting “Yes” to the “Logging enabled” option buttom in the lower left corner of the dialog box:

Turn On Logging

When you create/edit your code service, you can embed log() calls in strategic places to monitor exection progress:

Added Code Logs

You can then run/test the code service. After the service executes, click on the List icon. You should see this:

Empty Log

Click in the box just below “Debug Logs”. You will see a list of logs with a date. Select the top (most recent) one. This shows all of the logs for the last run of the service:

Debug Log

Note: For each service, the platform keeps the most recent 20 execution logs.

Finally, when you have finished you debugging and your service is working perfectly, You can turn off logging by selecting the Cog icon and selecting “No” for “Logging enabled. Note that you do not have to remove the logs from the code. They just become noop statements.