Issue
I enabled captureConsoleIntegration, and now my console.log calls (and other console output) show up in Sentry and consume error quota.
Applies To
All SaaS Customers and Self-Hosted Users
JavaScript SDK
Error Monitoring
Resolution
captureConsoleIntegration captures Console API calls and sends them to Sentry with captureMessage or captureException, depending on the console level. By default it captures log, info, warn, error, debug, and assert. Each captured call creates a Sentry event and uses error quota, even when the original console level was not error.
To limit which console methods create events, set the levels option. Only the listed levels are sent. For example, capture only error:
Sentry.init({
dsn: "https://[email protected]/0",
integrations: [
Sentry.captureConsoleIntegration({
levels: ["error"],
}),
],
});
See the CaptureConsole integration and its levels option.
If you want console output as Sentry Logs instead of error events, use consoleLoggingIntegration from the Logs documentation. That path does not replace captureConsoleIntegration for error-quota events.
