// YOUR APP COMPONENTS HERE
);
}
}
export default App;
```
--------------------------------
### Enable Source Maps for Node.js Debugging
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/node/README.md
This command line option is used to launch a Node.js application with source maps enabled. This improves the accuracy of stack traces when debugging, especially when using transpiled code.
```bash
node app.js --enable-source-maps
```
--------------------------------
### Configure AngularJS with Exceptionless
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/angularjs/README.md
Configures the Exceptionless client within an AngularJS application by injecting the $ExceptionlessClient service and calling its startup method with API key and default tags.
```js
angular
.module("app", ["exceptionless"])
.config(function ($ExceptionlessClient) {
await $ExceptionlessClient.startup((c) => {
c.apiKey = "API_KEY_HERE";
c.defaultTags.push("Example", "JavaScript", "angularjs");
});
});
```
--------------------------------
### Client Logs Management
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/example/browser/index.html
This section refers to the management of logs generated by the client itself. It implies that the Exceptionless client can generate and potentially submit its own internal logs for debugging purposes.
```javascript
/*
* Client Logs Management
* This refers to the internal logging capabilities of the Exceptionless client.
* The client might log its own operational events, errors, or status updates.
* These logs can be useful for diagnosing issues with the client integration itself.
*
* Example: Accessing or enabling client-side logging (hypothetical)
*/
// Assuming 'exceptionless' is the initialized client instance
// The client might have a configuration option to enable verbose logging:
// exceptionless.config.setOption('logLevel', 'Debug'); // Hypothetical setting
// Or a method to retrieve internal logs:
// const internalLogs = exceptionless.getInternalLogs();
// console.log('Exceptionless Client Internal Logs:', internalLogs);
/*
* Note: The specific mechanisms for managing client logs depend on the
* library's design. Often, these logs are directed to the browser's
* console or can be configured to be submitted as events.
*/
```
--------------------------------
### Enable Client Debug Logging
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Troubleshooting
Configures the Exceptionless client to output diagnostic messages to the console, which is crucial for diagnosing any issues with the client's operation. Dependencies: Exceptionless client library.
```javascript
exceptionless.ExceptionlessClient.default.config.useDebugLogger();
```
```nodejs
var client = require('exceptionless').ExceptionlessClient.default;
client.config.useDebugLogger();
```
--------------------------------
### Configure Server URL for Self-Hosted Instances
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Self-Hosted-Options
Sets the serverUrl to point to a self-hosted Exceptionless instance. This is essential for clients to communicate with your private Exceptionless deployment.
```javascript
exceptionless.ExceptionlessClient.default.config.serverUrl = 'http://localhost:50000';
```
```nodejs
var client = require('exceptionless.node').ExceptionlessClient.default;
client.config.serverUrl = 'http://localhost:50000';
```
--------------------------------
### Manually Submit Errors (Node.js)
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/README.md
Shows how to manually capture and submit exceptions to Exceptionless in a Node.js environment. It includes setting up the client with an API key and using a try-catch block to submit caught errors.
```javascript
import { Exceptionless } from "@exceptionless/node";
await Exceptionless.startup("API_KEY_HERE");
try {
throw new Error("test");
} catch (error) {
await Exceptionless.submitException(error);
}
```
--------------------------------
### Manually Update Configuration Settings
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Client-Configuration-Values
Provides the method to manually trigger an update of the client's configuration settings. This is useful for refreshing settings on demand.
```javascript
exceptionless.SettingsManager.updateSettings(client.config);
```
--------------------------------
### Set Application Version
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Configuration
Specifies the application version for the Exceptionless client. Setting an application version can enable additional functionality and is a good practice for tracking and managing exceptions across different releases.
```javascript
exceptionless.ExceptionlessClient.default.config.setVersion("1.2.3");
```
```nodejs
var exceptionless = require('exceptionless');
exceptionless.ExceptionlessClient.default.config.setVersion("1.2.3");
```
--------------------------------
### Configure Exceptionless Client Settings
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Configuration
Sets various configuration options for the Exceptionless client, such as including user name, machine name, IP addresses, cookies, POST data, and query string information. These settings control the data collected with each exception report.
```javascript
// Include the username if available.
exceptionless.ExceptionlessClient.default.config.includeUserName = false;
// Include the MachineName in MachineInfo.
exceptionless.ExceptionlessClient.default.config.includeMachineName = false;
// Include Ip Addresses in MachineInfo and RequestInfo.
exceptionless.ExceptionlessClient.default.config.includeIpAddress = false;
// Include Cookies, please note that DataExclusions are applied to all Cookie keys when enabled.
exceptionless.ExceptionlessClient.default.config.includeCookies = false;
// Include Form/POST Data, please note that DataExclusions are only applied to Form data keys when enabled.
exceptionless.ExceptionlessClient.default.config.includePostData = false;
// Include Query String information, please note that DataExclusions are applied to all Query String keys when enabled.
exceptionless.ExceptionlessClient.default.config.includeQueryString = false;
```
```nodejs
var exceptionless = require('exceptionless');
// Include the username if available.
exceptionless.ExceptionlessClient.default.config.includeUserName = false;
// Include the MachineName in MachineInfo.
exceptionless.ExceptionlessClient.default.config.includeMachineName = false;
// Include Ip Addresses in MachineInfo and RequestInfo.
exceptionless.ExceptionlessClient.default.config.includeIpAddress = false;
// Include Cookies, please note that DataExclusions are applied to all Cookie keys when enabled.
exceptionless.ExceptionlessClient.default.config.includeCookies = false;
// Include Form/POST Data, please note that DataExclusions are only applied to Form data keys when enabled.
exceptionless.ExceptionlessClient.default.config.includePostData = false;
// Include Query String information, please note that DataExclusions are applied to all Query String keys when enabled.
exceptionless.ExceptionlessClient.default.config.includeQueryString = false;
```
--------------------------------
### Submit Logs and Feature Usage
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/react/README.md
Illustrates how to send custom logs and track feature usage events using the Exceptionless client. These methods allow for detailed application monitoring beyond just errors.
```js
await Exceptionless.submitLog("Hello, world!");
await Exceptionless.submitFeatureUsage("New Shopping Cart Feature");
```
--------------------------------
### Send Logs, Feature Usages, and Not Found Events with Exceptionless Client
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Sending-Events
Demonstrates how to send various event types like logs, feature usages, and 404 errors using the Exceptionless client's fluent API. It covers specifying log levels, sources, and adding tags.
```javascript
var client = exceptionless.ExceptionlessClient.default;
// Node.Js
// var client = require('exceptionless').ExceptionlessClient.default;
client.submitLog('Logging made easy');
// You can also specify the log source and log level.
// We recommend specifying one of the following log levels: Trace, Debug, Info, Warn, Error
client.submitLog('app.logger', 'This is so easy', 'Info');
client.createLog('app.logger', 'This is so easy', 'Info').addTags('Exceptionless').submit();
// Submit feature usages
client.submitFeatureUsage('MyFeature');
client.createFeatureUsage('MyFeature').addTags('Exceptionless').submit();
// Submit a 404
client.submitNotFound('/somepage');
client.createNotFound('/somepage').addTags('Exceptionless').submit();
// Submit a custom event type
client.submitEvent({ message = 'Low Fuel', type = 'racecar', source = 'Fuel System' });
```
--------------------------------
### Submit Logs and Feature Usage Events
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/vue/README.md
Shows how to send custom log messages and track feature usage events to Exceptionless. These methods allow for detailed monitoring of application behavior beyond just errors. The Exceptionless client is accessible globally after startup.
```javascript
import { Exceptionless } from "@exceptionless/vue";
// Submit a log message
await Exceptionless.submitLog("Hello, world!");
// Submit a feature usage event
await Exceptionless.submitFeatureUsage("New Shopping Cart Feature");
```
--------------------------------
### Submit a Log Message
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/browser/README.md
Illustrates how to manually submit a log message using the Exceptionless client after it has been configured. This is useful for tracking specific events or messages within your application.
```javascript
await Exceptionless.submitLog("Hello world!");
```
--------------------------------
### Benchmark: Prune Large Object
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/example/browser/index.html
This section describes a benchmark test designed to measure the performance of pruning large objects, executed 1000 times. It's intended to stress-test object manipulation capabilities.
```javascript
/*
* Benchmark: Prune Large Object (1000 times)
* This is a conceptual description of a benchmark test.
* Actual implementation would involve creating a large object,
* defining a pruning function, and timing its execution over 1000 iterations.
*/
/*
function createLargeObject() {
const obj = {};
for (let i = 0; i < 1000; i++) {
obj[`key_${i}`] = { nested: i, data: Math.random() };
}
return obj;
}
function pruneObject(obj) {
// Logic to prune the object, e.g., remove specific keys or deep clean
// For example, removing keys with null values or limiting nesting depth
return obj;
}
const largeObject = createLargeObject();
const startTime = performance.now();
for (let i = 0; i < 1000; i++) {
pruneObject(JSON.parse(JSON.stringify(largeObject))); // Operate on a copy
}
const endTime = performance.now();
const duration = endTime - startTime;
// Log the benchmark result
// exceptionless.submitLog(`Prune Large Object benchmark took ${duration}ms`, 'Information');
*/
```
--------------------------------
### Send Additional Information with Events (Node.js)
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/README.md
Illustrates how to enrich error reports with custom data using the event builder API in Node.js. This includes setting reference IDs, properties, tags, user identity, and geographical coordinates before submitting the event.
```javascript
import { Exceptionless } from "@exceptionless/node";
await Exceptionless.startup("API_KEY_HERE");
try {
throw new Error("Unable to create order from quote.");
} catch (error) {
await Exceptionless.createException(error)
// Set the reference id of the event so we can search for it later (reference:id).
.setReferenceId("random guid")
// Add the order object (the ability to exclude specific fields will be coming in a future version).
.setProperty("Order", order)
// Set the quote number.
.setProperty("Quote", 123)
// Add an order tag.
.addTags("Order")
// Mark critical.
.markAsCritical()
// Set the coordinates of the end user.
.setGeo(43.595089, -88.444602)
// Set the user id that is in our system and provide a friendly name.
.setUserIdentity(user.Id, user.FullName)
// Submit the event.
.submit();
}
```
--------------------------------
### Disable Automatic Configuration Updates
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Client-Configuration-Values
Shows how to disable the automatic checking and updating of client configuration settings when the client is idle. Setting the interval to -1 prevents background updates.
```javascript
client.config.updateSettingsWhenIdleInterval = -1;
```
--------------------------------
### Process Event Queue
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Troubleshooting
Manually triggers the processing of the event queue to ensure events are sent before an application terminates. This can help when the application process ends abruptly. Dependencies: Exceptionless client library.
```javascript
exceptionless.ExceptionlessClient.default.config.queue.process();
```
```nodejs
var client = require('exceptionless').ExceptionlessClient.default;
client.config.queue.process();
```
--------------------------------
### Conditionally Cancel Log Submission
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Client-Configuration-Values
Demonstrates how to conditionally cancel log event submission at runtime using a client-side plugin. This allows disabling log submissions based on a configuration setting without redeploying the application.
```javascript
exceptionless.ExceptionlessClient.default.config.addPlugin('Conditionally cancel log submission', 100, function (context, next) {
var enableLogSubmission = context.client.config.settings['enableLogSubmission'];
// only cancel event submission if it’s a log event and
// enableLogSubmission is set to a value and the value is not true.
if (context.event.type === 'log' && (!!enableLogSubmission && enableLogSubmission !== 'true')) {
context.cancelled = true;
}
next();
});
```
--------------------------------
### Submit Log Message with Exceptionless Client
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/angularjs/README.md
Demonstrates how to use the injected $ExceptionlessClient to submit a log message from anywhere within your AngularJS application.
```js
await $ExceptionlessClient.submitLog("Hello world!");
```
--------------------------------
### Add Custom Properties and Metadata to Exceptionless Events
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Sending-Events
Illustrates how to enrich exception reports with custom data using the event builder API. This includes setting reference IDs, properties, tags, geo-location, and user identity before submitting.
```javascript
var client = exceptionless.ExceptionlessClient.default;
// Node.Js
// var client = require('exceptionless').ExceptionlessClient.default;
try {
throw new Error('Unable to create order from quote.');
} catch (error) {
client.createException(error)
// Set the reference id of the event so we can search for it later (reference:id).
// This will automatically be populated if you call client.config.useReferenceIds();
.setReferenceId('random guid')
// Add the order object (the ability to exclude specific fields will be coming in a future version).
.setProperty("Order", order)
// Set the quote number.
.setProperty("Quote", 123)
// Add an order tag.
.addTags("Order")
// Mark critical.
.markAsCritical()
// Set the coordinates of the end user.
.setGeo(43.595089, -88.444602)
// Set the user id that is in our system and provide a friendly name.
.setUserIdentity(user.Id, user.FullName)
// Submit the event.
.submit();
}
```
--------------------------------
### Manually Submit Exceptions with Exceptionless Client
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Sending-Events
Shows how to manually capture and send exceptions to the Exceptionless service using a try-catch block. This is useful for reporting errors that are caught but still need to be logged.
```javascript
var client = exceptionless.ExceptionlessClient.default;
// Node.Js
// var client = require('exceptionless').ExceptionlessClient.default;
try {
throw new Error('test');
} catch (error) {
client.submitException(error);
}
```
--------------------------------
### Submit Exception from Utility Function
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/vue/README.md
Demonstrates how to manually submit a caught exception to Exceptionless from a non-component function. This is useful for error handling in utility modules or background tasks. The Exceptionless client is a singleton and can be imported directly.
```javascript
import { Exceptionless } from "@exceptionless/vue";
export const myUtilityFunction = async () => {
try {
// Handle successful run of code
} catch (e) {
// If there's an error, send it to Exceptionless
await Exceptionless.submitException(e);
}
};
```
--------------------------------
### Submit Exception from Utility Function
Source: https://github.com/exceptionless/exceptionless.javascript/blob/main/packages/react/README.md
Shows how to catch an error in a JavaScript utility function and submit it to Exceptionless using `submitException`. This ensures errors occurring outside React components are captured and reported.
```js
export const myUtilityFunction = async () => {
try {
// Handle successful run of code
} catch (e) {
// If there's an error, send it to Exceptionless
await Exceptionless.submitException(e);
}
};
```
--------------------------------
### GDPR Compliance: Disable PII Collection (JavaScript/Node.js)
Source: https://github.com/exceptionless/exceptionless.javascript/wiki/Configuration
Configures the Exceptionless client to disable the collection of Personally Identifiable Information (PII) for GDPR compliance. This can be done via a query parameter in the script tag or by setting a configuration property on the client instance.
```html
```
```javascript
exceptionless.ExceptionlessClient.default.config.includePrivateInformation = false;
```
```javascript
var exceptionless = require('exceptionless');
exceptionless.ExceptionlessClient.default.config.includePrivateInformation = false;
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.