If you are testing out a botlet in the Test Chat tool and you receive a message that says, “Sorry something went wrong,” the cause of the error could mean several different things. For example, a failure may be caused by one of the variables inside the botlet’s SCL code not being defined correctly. Another example of a botlet failure might be caused by an expired developer token that prevents the botlet from communicating with the runtime API.
To narrow down and find the root cause of a botlet failure, you must examine the contents of the error reports. If you configured a botlet’s SCL code to generate a log report, refer to them when conducting the troubleshooting process.
An error report is an unintentional message. What this means is that they get automatically generated when something goes wrong with the botlet’s functionality in the live site or when it is being tested against the runtime API in the Test Chat tool. If nothing goes wrong with a botlet’s functionality, then no error reports are generated.
Log reports are intentional messages that developers configure inside their botlet’s SCL code in order to have them generated. They are an encapsulation of the botlet error message running through the backend botlet runtime API server. Logs can also be configured in the botlet’s SCL code to send messages to the log console on a line-by-line basis. These SCL commands and System Variable are described below.
SCL Commands and System Variable Descriptions¶
The SCL TRY command is for general error handling, and it is used for blocks of statement. Each
TRY statement must be associated with at least one
Accessing Botlet Log and Error Reports¶
Botlet log and error reports are accessible from the Logs menu tab. You can apply various filters to generate a narrowed down a list of reports to help you quickly isolate an issue.
Note: If you notice that there are no log or error reports for a botlet, it means that none have been generated for it. A log report will get generated only if the SCL command
LOG is used in a botlet’s SCL code. An error report will only get generated when a failure occurs with a botlet functionality or there is something not properly defined in the botlet’s SCL code.
To access a botlet’s logs and error reports, refer to the steps below.
- In the Items Tree, click the name of the organization, and then click a botlet listed under it.
- In the Control Panel, click the Logs menu tab.
Note: If you want to maximize or minimize the report details list, click the left or right arrows in the Control Pane.
In the section that follows, we are going to explore the various filter settings. Applying filter setting can enable you to control what type of reports that get displayed in a time range.
Applying filters can help you narrow down an extensive list of log and error reports displayed inside in the report details panel.
To access the filter options in the Logs menu tab, click Filters.
The Channels filter drop-down list enables you to select all channels, or you can select channels individually.
The Log Type drop-down list defaults to the ALL option. This means that both log and error reports will display in the report details panel. Logs are not intentional messages and must be enabled in the SCL code of a botlet. If you select the option to ALL and there are no Log reports, then this means that your botlet’s SCL code is not configured to produce them.
The Time Range panel allows you to produce log and error reports that occur in time durations such as in the past hour or up to the past 4 weeks. The default option is set to All.
- Past Hour
- Past Day
- Past 3 Days
- Past Week
- Past 4 Weeks
Logs and error reports can be filtered down to a botlet’s Session ID. Copy and paste the Session ID into the text field, and then click Apply.
You can filter on specific pieces of information contained inside the log content of a botlet. Copy and paste the information in the text field that you want to filter, and then click Apply.
Note: A log report will get generated only if the LOG SCL command is used in a botlet’s SCL code.
Log Content Example
The image below shows an example of the content contained inside a log.
The Channel Key is a unique identifier that gets generated when a user interacts with a botlet through a channel like Cortana.
You can filter through a list of log and error reports by coping and pasting a specific Channel Key into the text field, and then clicking Apply.
Channel Key Example
The image below shows an example of what a Channel Key looks like.
Log and error reports can be filtered down to a botlet’s Trace ID. The Trace ID is an identifier that gets generated from the input response of each interaction with the botlet.
Trace ID Example
The Line Number filter is used for searching a particular line in the botlet’s SCL code.
Line Code Number Example