Log inSign up
Home
Webex Contact Center
  • Overview
  • Service Apps
  • API REFERENCE
  • AI Assistant for Developers
  • Changelog

Webex Contact Center

Logging and Diagnostics

Create widget loggers and collect, download, and clean up Desktop widget logs.

anchorBefore You Begin

anchor

Install and initialize the SDK as described in Get Started with the Desktop SDK. Your widget must run inside Webex Contact Center Desktop.

anchorLogger Module

anchor

The Desktop.logger module creates and maintains the client-side log messages for third-party widgets.

With individually set up logger, you can integrate with the Desktop logging system (that is being used for telemetry and problem report) and at the same time maintain a clear origin definition. We recommend that you create a logger instance for your widgets only once per project. Create a logger instance in a utils.ts file and reuse throughout the components.

Example

// utils.ts file
import { Desktop } from "@wxcc-desktop/sdk";

export const logger = Desktop.logger.createLogger("my-custom-component");

In Component.ts:

import { logger } from "./utils.ts";

logger.info("Info test"); // logger.info => 2020-12-16 13:11:04:971["my-custom-component", "Info test"]
logger.warn("Warn test"); // logger.info => 2020-12-16 13:11:04:971["my-custom-component", "Warn test"]
logger.error("Error test"); // logger.info => 2020-12-16 13:11:04:971["my-custom-component", "Error test"]

For more information on the widget starter example, see Cisco Webex Contact Center Widget Starter.

You can obtain logs in a JSON format or as a downloadable *.log file specifically for your widget. The following are the available options to download the logs:

// Download logs as a JSON file for "my-custom-component" prefix:
Desktop.logger.browserDownloadLogsJson("my-custom-component");

// Download logs as a Text file for "my-custom-component" prefix:
Desktop.logger.browserDownloadLogsText("my-custom-component");

// Get logs as Objects collection for "my-custom-component" prefix:
Desktop.logger.getLogsCollection("my-custom-component");

// Get logs as base64 encoded url ready to put into link href to initiate browser download as a JSON file for "my-custom-component" prefix:
Desktop.logger.getLogsJsonUrl("my-custom-component");

// Get logs as base64 encoded url ready to put into link href to initiate browser download as a Text file for "my-custom-component" prefix:
Desktop.logger.getLogsTextUrl("my-custom-component");

// Cleanup logs from Local Storage for "my-custom-component" prefix:
Desktop.logger.cleanupPrefixedLogs("my-custom-component");

You can also download logs from the Desktop. For instructions, see Download error reports in Webex Help Center.

Methods
createLogger(my-custom-component)

Initializes the logger for third-party widgets that help in logging related information to a particular component. Different methods are used based on the log type. The messages such as info, warn, and error are logged in the browser console.

Example

const logerOne = Desktop.logger.createLogger("my-custom-component-one");
const logerTwo = Desktop.logger.createLogger("my-custom-component-two");

logerOne.info("Info test"); // console.log => "my-custom-component: Info:test"
logerTwo.warn("Warn test"); // console.log => "my-custom-component: Warn:test"
logerOne.error("Error test"); // console.log => "my-custom-component: Error:test"

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
browserDownloadLogsJson(my-custom-component)

Downloads logs as a JSON file for the my-custom-component prefix.

Example

Desktop.logger.browserDownloadLogsJson("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
browserDownloadLogsText(my-custom-component)

Downloads logs as a text file for the my-custom-component prefix.

Example

Desktop.logger.browserDownloadLogsText("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
getLogsCollection(my-custom-component)

Retrieves logs as a collection of objects for the my-custom-component prefix.

Example

Desktop.logger.getLogsCollection("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
getLogsJsonUrl(my-custom-component)

Retrieves logs as a Base64 encoded URL to initiate browser download as a JSON file for the my-custom-component prefix.

Example

Desktop.logger.getLogsJsonUrl("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
getLogsTextUrl(my-custom-component)

Retrieves logs as a Base64 encoded URL to initiate browser download as a text file for the my-custom-component prefix.

Example

Desktop.logger.getLogsTextUrl("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes
cleanupPrefixedLogs(my-custom-component)

Cleans up logs from the local storage for the my-custom-component prefix.

Example

Desktop.logger.cleanupPrefixedLogs("my-custom-component");

Parameters

NameTypeDescriptionRequired
my-custom-componentStringName of the component. Example: email component, chat component.Yes

anchorWebex Metrics Module

anchor

Availability: The existing SDK documentation identifies this as an internal module. Confirm its availability with your Cisco contact before relying on it in a third-party widget. The Webex Metrics module is an internal module that is responsible for monitoring and measuring performance, usage, and behavioral data from widgets.

Methods
trackBehavioralEvent
Desktop.webexMetricsInternal.trackBehavioralEvent("Call Consult Clicked",  {
          Status: "Success",
          interactionId: "49bcf26b-ec75-4351-89fa-55d54682c20c",
          media_type: "telephony",
          Reason: "AgentConsultEnded"
        });

Parameters

NameTypeDescriptionRequired
namestringName of the event to be trackedYes
optionsEventPayloadAdditional data included in the event payloadNo

The trackBehavioralEvent function is used to log and track user interactions and behavioral events within widgets. It takes an event name and an optional options object as parameters.

anchorRelated Pages

anchor
  • Agent Desktop overview
  • Desktop SDK Reference
In This Article
  • Before You Begin
  • Logger Module
  • Webex Metrics Module
  • Related Pages

Connect

Support

Developer Community

Developer Events

Contact Sales

Handy Links

Webex Ambassadors

Webex App Hub

Resources

Open Source Bot Starter Kits

Download Webex

DevNet Learning Labs

Terms of Service

Privacy Policy

Cookie Policy

Trademarks

© 2026 Cisco and/or its affiliates. All rights reserved.