This guide covers how to control the SDK's log verbosity, size its in-memory log buffer, and export captured logs as a file to share with Avaya support when investigating an issue.
Personas: Developer / Integrator - sets log verbosity and exports logs to share with Avaya support. Applies across all user roles.
The SDK writes structured log entries to the browser console and simultaneously captures them in a rolling in-memory buffer. You control three things:
ERROR, WARN, INFO, DEBUG, or OFF), set at startup or changed at runtime.Blob.These are static methods on AvayaInfinityAgentSdk and the buffer is decoupled from the session lifecycle, so they are callable across the entire lifecycle - before AvayaInfinityAgentSdk.init, while running, and after AvayaInfinityAgentSdk.destroy. The buffer resets only on page reload.
Set the initial level at startup via AvayaInfinityAgentSdkInitParams.logLevel, or change it at any time with AvayaInfinityAgentSdk.setLogLevel - useful for raising verbosity to DEBUG during a live incident and reverting once captured:
import { AvayaInfinityAgentSdk, LogLevel } from "@avaya/infinity-agent-sdk";
await AvayaInfinityAgentSdk.init({
avayaInfinityHost: "api.avayacloud.com",
clientId: "your-client-id",
oAuthRedirectUri: window.location.origin,
logLevel: LogLevel.INFO,
});
// Raise verbosity while reproducing an issue
AvayaInfinityAgentSdk.setLogLevel(LogLevel.DEBUG);
The buffer holds the most recent entries up to its capacity (default 2000). Size it at startup via AvayaInfinityAgentSdkInitParams.logBufferCapacity, or at runtime with AvayaInfinityAgentSdk.setLogBufferCapacity. The requested value is truncated to an integer and clamped to [100, 5000]; the method never throws and returns the effective capacity that took effect:
const effective = AvayaInfinityAgentSdk.setLogBufferCapacity(5000);
console.log("Log buffer now holds up to", effective, "entries");
When you shrink the buffer below the current entry count, the most recent entries are retained and the oldest are discarded - export first if you need the older history.
AvayaInfinityAgentSdk.exportLogs returns a point-in-time snapshot as an application/json Blob wrapping an SdkLogExport envelope (SDK version, timestamp, and the captured SdkLogEntry list). It is non-destructive, so it is safe to call repeatedly. The SDK does not trigger a download itself - the host application decides what to do with the Blob:
const blob = AvayaInfinityAgentSdk.exportLogs();
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "avaya-sdk-logs.json";
a.click();
URL.revokeObjectURL(url);
To merge the SDK's entries into an existing log store instead, read the Blob as text and parse it as an SdkLogExport.
These utilities sit outside the interaction error families. AvayaInfinityAgentSdk.exportLogs and AvayaInfinityAgentSdk.setLogBufferCapacity never throw - out-of-range capacities are adjusted rather than rejected. AvayaInfinityAgentSdk.setLogLevel throws a typed AvayaInfinityAgentSdkError with code ASE_0004 if passed a value that is not a valid LogLevel.