Use the Logger

Vonage Cloud Runtime sessions come equipped with a logger to generate detailed events from your application. The logs will be visible on the Cloud Runtime dashboard.

Method Signature

Types

This function uses LogLevels for the severity of the log and LogContext to attach additional information to the log:

  • LogLevels: (String) The log level, e.g. error, warn, info, or debug.
  • LogContext:
    • actionName: (String)
    • payload: (String)
    • result: (String)

Using the Logger

The Logger has multiple log levels for you to use depending on your needs and supports attaching a context to the log:

Here is an example of a log:

Here is the same log on the dashboard:

Cloud Runtime dashboard rendering the above log object

By using varying log levels, you can filter specifically for the severity level you are interested in on the dashboard.