Error Logger and Remote Debugger for Node.js Apps
:star: We appreciate your star. It helps!
Table of Contents
Getting Started
Install
Errsole is a Node.js module. You can install this module using the npm install command:
npm install errsole
Configure
You must obtain a unique token to configure the Errsole module in your app.
Follow the steps below to generate a unique token:
- Click on the button below to go to the Errsole website.
- Create an Errsole account or sign in with an existing one.
- Create an entry for your app.
- Copy the code snippet generated for your app, which includes a unique token.
- Insert the code snippet as the first line of your app's main file.
- Deploy your app as usual. Once deployed, Errsole will start capturing errors and associating them with your app's entry in the Errsole platform.
![Setup Errsole](../assets/setup-errsole-button-20230922.webp?raw=true)
Example
const errsole = require('errsole');
errsole.initialize({
framework: 'express',
token: '[Your Errsole Token]',
exitOnException: true,
skipRoutes: [{
method: 'POST',
path: '/users/login'
}],
filterRoutes: [{
method: 'PUT',
path: '/users/:userId/profile'
}],
enableSessionLogs: true,
responseTimeThreshold: 1000,
slowRequestsTimeInterval: 24,
enableDebugger: true,
evalExpression: true
});
const express = require('express');
const app = express();
app.get('/', function (req, res) {
res.send('Hello World');
});
app.listen(3000);
Advanced Configuration
Name | Type | Description |
---|
framework | string | Required. Your Node.js framework name. |
token | string | Required. Create a unique token for your app on the Errsole website. |
exitOnException | boolean | Optional. The default value is true.
By default, Errsole will exit the process after capturing an uncaught exception. If this is not the behavior you want, you can disable it by setting exitOnException to false. |
skipRoutes | Array | Optional. The default value is [].
Errsole does not save any HTTP requests that match the routes specified in this list. |
filterRoutes | Array | Optional. The default value is [].
Errsole only captures the Method, URL, and Status Code of HTTP requests that match the routes specified in this list. |
enableSessionLogs | boolean | Optional. The default value is true.
This parameter controls whether to save session logs in addition to error details. For more information on session logs, please click here. |
responseTimeThreshold | number | Optional. The default value is 1000.
This parameter specifies a benchmark duration in milliseconds that Errsole uses to recognize slow HTTP requests. By default, this threshold is set to 1000 milliseconds (1 second), meaning that any HTTP request that takes longer than one second to complete is categorized as slow. |
slowRequestsTimeInterval | number | Optional. The default value is 24.
This parameter defines a designated time interval for gathering data on slow requests. You can select from four valid options: 1, 6, 12, and 24, corresponding to 1-hour, 6-hour, 12-hour, and 24-hour time intervals. |
enableDebugger | boolean | Optional. The default value is true.
If false, the Errsole Debugger is disabled. |
evalExpression | boolean | Optional.
If true, your developers have the ability to evaluate JavaScript expressions while debugging an error.
This feature allows your developers to debug your app's code more effectively, but it also grants them the ability to run arbitrary code on your server.
You have two options: You can set it to false here to disable the eval expression option for all developers, or you can set it to true here and manage the permissions of each developer on the errsole website. |
Features
Error Logging
Errsole captures and saves all errors that occur in your app across all servers and environments.
- Centralized error logging
- Errors
- Uncaught exceptions
- 5xx server errors
- Error grouping
Request Logging
In addition to capturing errors, Errsole also captures the corresponding HTTP requests that caused the errors.
- HTTP requests that caused errors
- HTTP requests that caused uncaught exceptions
- HTTP requests with 5xx error responses
Session Logs
Sometimes, the issue might be related to the request body, which could have been constructed based on the responses from previous requests. In the session logs, Errsole saves the series of requests made by the user leading up to the error.
Error Reproduction
Errsole starts a sandbox app on your server, which is a clone of your live app. Within this sandbox app, you can reproduce errors and inspect every line of the code without affecting the live app.
- Reproduce errors
- Reproduce uncaught exceptions
- Reproduce 5xx server errors
- Your live app is unaffected
- Your app users are unaffected
Remote Debugging
With a feature-rich debugger directly connected to a sandbox app, you can set breakpoints, reproduce errors, inspect variables, and verify the fixes - all without affecting your live app.
- Set breakpoints
- Inspect variables
- Verify the fixes
- Your live app is unaffected
- Your app users are unaffected
Collaboration
You can invite developers to your app, manage their permissions, and assign errors to individual developers. These developers can then troubleshoot the assigned errors within their dedicated sandbox apps.
- Invite developers
- Assign errors
- Concurrent debugging
Demo Video
https://github.com/errsole/errsole.js/assets/3775513/f7dadda0-9dc9-4827-9d96-2b7e41473a5d
Try Live Demo
Experience Errsole firsthand by troubleshooting errors in our demo app:
![Try Live Demo](../assets/try-live-demo-button-20230922.webp?raw=true)
Documentation
For a complete product documentation, please visit our documentation page:
https://www.errsole.com/documentation/
Support
:star: We appreciate your star. It helps!
If you run into any issues, please email us at support@errsole.com.
For bug reports, please open an issue on GitHub.
License
MIT