Atatus captures all exceptions and errors in your Node.js applications by default. To capture console.error messages specifically, you need to enable the captureConsoleErrors setting.
Configuration Options
| Option | Description | Type |
|---|---|---|
| captureConsoleErrors | Enable capturing of console.error messages as errors |
boolean |
Sample Node.js Agent Configuration:
atatus.start({
captureConsoleErrors: true
});
Environment Variable Configuration:
| ENVIRONMENT | Configuration | Example |
|---|---|---|
| ATATUS_CAPTURE_CONSOLE_ERRORS | captureConsoleErrors | true or false |
How to Enable captureConsoleErrors
Use one of the following methods to enable this setting:
Option 1: Using atatus.js
import atatus from 'atatus-nodejs';
atatus.start({
licenseKey: "YOUR_LICENSE_KEY",
appName: "YOUR_APP_NAME",
captureConsoleErrors: true
});
export default atatus;
Option 2: Using Environment Variables
# set to env file
export ATATUS_LICENSE_KEY="YOUR_LICENSE_KEY"
export ATATUS_APP_NAME="YOUR_APP_NAME"
export ATATUS_CAPTURE_CONSOLE_ERRORS=true
This setting ensures that every console.error message is reported as an error, helping your team stay informed of issues in real time.
+1-415-800-4104