Debugging apps that use the serverless feature can be a little tricky once they are in production. To make this easy, the Freshworks platform enables serverless logging so you can add log messages in the server.js file and then view them in the App Settings page.
1. The maximum supported length of each log is 2000 characters beyond which the log is truncated.
2. At present, viewing serverless logs is possible for custom apps that have at least one installation parameter (iparam).
You can add logs to the server.js file with one of the following severity levels.
Info: Use this severity level to log general debug or status messages.
console.info("Starting the registration for new user"); console.info(JSON object);
Error: Use this severity level to log errors or warnings.
console.error("The authentication parameters are invalid"); console.error("Error details", JSON object);
Once the custom app is installed, select the Settings icon and then choose the Serverless Logs tab to view the logs.
Logs are displayed in different colors to reflect their severity level. To download them, click the Export button.