Logging

Logging is a crucial part of the development process. It is the most ubiquitous way of getting insights into your application behavior. We collect 4 types of logs from your application.

Console

To log something from within your action code, you can use sdk.console.log(). This will generate a log of type console.

The console object also holds other methods, and is similar to the Node.js console module

HTTP

When using sdk.request(), we automatically collect detailed information about the http call.

Bundle

Each action invocation generates a bundle log, which will contain the input and output of your action execution.

Error

This type of logs are generated automatically when an unhandled error is thrown from within your app code. You can also log your own errors using sdk.console.error

Viewing your logs

To view the latest logs from your app, run from the terminal

Copy
Copied
cldk logs
Note:

You should run this command from within your app root directory

For more information about this command, check cldk logs

For now, it will only print out the logs of type console

It is also possible to access the logs online at https://app.chatlayer.ai/app-integrations/[appId]/logs

We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.