Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

/**
* Configuration for extra exceptions information sent with the exception telemetry.
* @example
* ```js
* const appInsights = new ApplicationInsights({
config: {
connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
expCfg: {
inclScripts: true,
expLog : () => {
return {logs: ["log info 1", "log info 2"]};
},
maxLogs : 100
}
}
});
appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical});
* ```
* @interface IExceptionConfig
*/
export interface IExceptionConfig{
/**
* If set to true, when exception is sent out, the SDK will also send out all scripts basic info that are loaded on the page.
* Notice: This would increase the size of the exception telemetry.
* @defaultvalue true
*/
inclScripts?: boolean;

/**
/**
* Callback function for collecting logs to be included in telemetry data.
*
* The length of logs to generate is controlled by the `maxLogs` parameter.
Expand All @@ -20,6 +41,12 @@ export interface IExceptionConfig{
*
* @property {number} maxLogs - Specifies the maximum number of logs that can be generated. If not explicitly set, it defaults to 50.
*/
expLog: () => { logs: string[] },
maxLogs: number
expLog?: () => { logs: string[] },

/**
* The maximum number of logs to include in the telemetry data.
* If not explicitly set, it defaults to 50.
* This is used in conjunction with the `expLog` callback.
*/
maxLogs?: number
}