Is anyone aware of an issue with logging in Virtual Agent Designer?

Connor15
Tera Contributor

When trying to log a message to the Log tab in Virtual Agent Designer topic tests the messages aren't showing.

The logs are still showing under system logs. However this is a little cumbersome and would be preferable to show in the Logs in the Test conversation like they previously did.

See attached screenshot for the code written in a Script Action block. Also tested this in a regular Bot Response, same problem.

I am trying to get this to work in Global scope, but have tried this in an application scope as well.

In the application scope the script throws an error as some of the same methods used aren't available. But removing those scripts still doesn't allow the messages to show on the Logs tab.

Last known working in Quebec version of Service Now. Maybe Rome.

Any help would be greatly appreciated as it's useful when testing decision tree logic in scripts for VA.

 

5 REPLIES 5

Drothery
Giga Guru

I haven;'t got an answer, but I do have the same issue, its not just manual log lines either (such as gs.info()) - but actual errors in scripts.

Nothing useful shows up in the Log tab on the topic previews, where it used to show the Javascript errors.

 

Is there a system property or soemthing that has to be enabled to get this to work?

Connor15
Tera Contributor

As a further point to this. It should be possible to log messages to this tab using the methods stated. According to this KB Test Virtual Agent topics (servicenow.com). Any help would be greatly appreciated.

Chris D
Kilo Sage
Kilo Sage

Yes, this is a known issue, tracked under PRB1554065 When adding debug logging statements into a Virtual Agent topic, the scripts don't display the test ....

I submitted a HI case to ServiceNow after we upgraded from Quebec to San Diego a few months ago and this is the response I got at the end of May (alongside the attached PRB):

Issue:
Virtual Agent Admins lost access to logs

Analysis:
This is an issue with the platform that is being addressed and targeted for a fix in a future release.

Solution Proposed:
The PRB is still in development, but there is a workaround that has been provided. We suggest looking for the debug messages in System Log > All (syslog.list) table instead of looking at the topic test window. Within the System Log table, filter the "Message" column to look for the particular debug message.

Edson da Silva
Mega Guru

In addition to the information provided by @Chris D, as a workaround, you can follow these steps to retrieve the logs again in the Virtual Agent Designer view.

 In the table sys_ws_operation, search for Logging and change the script to: 

(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

    if (request.pathParams.flag == "enable") {
        GlideSessionDebug.enable("cs_debug");
        GlideSessionDebug.enable("log");
    }
    else if (request.pathParams.flag == "disable") {
        GlideSessionDebug.disable("cs_debug");
        GlideSessionDebug.disable("log");
    }
    else {
        response.setStatus(400);
    }

})(request, response);