CaptureConsole

Import name: Sentry.captureConsoleIntegration

This integration captures all Console API calls and redirects them to Sentry using the SDK's captureMessage or captureException call, depending on the log level. It then re-triggers to preserve default native behavior:

This integration requires you to install @sentry/integrations next to your main SDK package.

Copied
import * as Sentry from "@sentry/node";
import { captureConsoleIntegration } from "@sentry/integrations";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [captureConsoleIntegration()],
});

Type: string[]

Array of methods that should be captured. Defaults to ['log', 'info', 'warn', 'error', 'debug', 'assert']

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").