Skip to content

There is no way to disable or to filter the console logs based on level #7138

@stefanpruna

Description

@stefanpruna

Problem Statement

Hello. I have set up my breadcrumbs in a way that console.logs that are level info or debug would not create automatic breadcrumbs.
My current sentry integration configuration is the following:

beforeBreadcrumb(breadcrumb) {
    if (
      (breadcrumb.level === "info" || breadcrumb.level === "debug") &&
      breadcrumb.category === "console"
    ) {
      return null;
    }
    return breadcrumb;
  },
integrations: [
    new CaptureConsoleIntegration({
      // array of methods that should be captured
      levels: ["warn", "error", "assert"],
    }),
    new Sentry.Replay({
      // masking all text fields by default.
      maskAllText: true,
      blockAllMedia: true,
    }),
  ],

Session replay records all logs in the console tab of Session Replay. Is there a configuration to either fully disable the console.logs in session replay, or allow only certain levels to be sent to Sentry.

Solution Brainstorm

I think the Sentry.Replay integration could use the CaptureConsoleIntegration object from the integrations array, or another config field could be added inside Sentry.Replay{}.
Console:Disable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions