Skip to main content

Console Capture

Signal JS automatically captures console logs, JavaScript errors, and unhandled promise rejections.

Configuration

Captured Events

Console Log Events

JavaScript Error Events

Unhandled Rejection Events

Console Levels

Control which console levels are captured:
Only logs matching these levels will be captured. For example, to capture only errors and warnings:

Error Capture

Uncaught Errors

Automatically capture uncaught JavaScript errors:
These are captured with full stack traces, file names, line numbers, and column numbers.

Unhandled Promise Rejections

Capture promises that are rejected without a .catch() handler:

Message Limits

Maximum Message Length

Limit the length of captured messages to prevent excessive data:
Messages exceeding this limit will be truncated.

Maximum Arguments

Limit the number of arguments captured per log call:
Only the first N arguments will be captured.

Sensitive Data Masking

Automatically mask sensitive data in console logs:
Example:
The SDK automatically detects and masks:
  • Passwords
  • Credit card numbers
  • Social Security Numbers
  • API keys
  • JWT tokens
  • Email addresses (partially)

Example: Complete Configuration

Use Cases

  • Debug production issues by seeing console logs from user sessions
  • Track JavaScript errors with full stack traces
  • Monitor unhandled rejections to catch async errors
  • Correlate errors with user actions in session replay
  • Debug API issues by seeing console logs alongside network requests

Best Practices

  1. Enable error capture in production to catch unexpected errors
  2. Use appropriate log levels (error, warn) for important messages
  3. Avoid logging sensitive data - rely on automatic masking as a safety net
  4. Set reasonable limits on message length and arguments to prevent excessive data
  5. Review captured logs regularly to identify common issues