Skip to content

Disabling console log (error, warn, etc) in browser #12618

Closed

Description

@rrjanbiah

(Since, this is of type question and feature request, posting here. Apologies)

When it comes to JavaScript, as Sentry is logging all console messages in its dashboard, is there anyway to hide those error / warn messages in browser? If not, kindly some config.

Idea is to avoid displaying errors in browser console for end users.. as we already captured those errors through Sentry. TIA

Activity

  1. sultan99 commented on Dec 12, 2019

    @sultan99

    any solution?

  2. sultan99 commented on Dec 12, 2019

    @sultan99

    this helped me:

    Sentry.init({
      . . .
      debug: false, // before it was true
    })
  3. upschmidtcreek commented on Feb 25, 2020

    @upschmidtcreek

    To add some more detail to this. Even if you add "debug: false" to Sentry.init(), Sentry will still log events to the console.

    Example on first page load:
    Sentry Logger [Log]: Integration installed: InboundFilters
    Sentry Logger [Log]: Integration installed: FunctionToString
    Sentry Logger [Log]: Integration installed: TryCatch
    Sentry Logger [Log]: Integration installed: Breadcrumbs
    Sentry Logger [Log]: Global Handler attached: onerror
    Sentry Logger [Log]: Global Handler attached: onunhandledrejection
    Sentry Logger [Log]: Integration installed: GlobalHandlers
    Sentry Logger [Log]: Integration installed: LinkedErrors
    Sentry Logger [Log]: Integration installed: UserAgent

    If I disable debugging in the Sentry init config, I would expect no console output from Sentry.

  4. kamilogorek commented on Feb 25, 2020

    @kamilogorek
    Contributor

    @upschmidtcreek can you provide a repro for this? The log you pasted comes exactly from the debug logger, which is controlled by debug config in init call.

    I'll kindly reopen this issue if reproducible code is provided.

  5. kamilogorek commented on Feb 25, 2020

    @kamilogorek
    Contributor

    Regarding OPs question, no, there's no way to do this, as we don't overwrite the default handlers.

  6. locked and limited conversation to collaborators on Dec 18, 2020
  7. added a commit that references this issue on Feb 11, 2025
    8035347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions