Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rrjanbiah opened this issue Apr 2, 2019 · 6 comments
Closed

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

rrjanbiah opened this issue Apr 2, 2019 · 6 comments
Assignees

Comments

@rrjanbiah
Copy link

(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

@sultan99
Copy link

any solution?

@BYK
Copy link
Member

BYK commented Dec 12, 2019

I think you're looking for this: https://docs.sentry.io/enriching-error-data/breadcrumbs/?platform=browsernpm#breadcrumb-customization

@kamilogorek - is there any other way for doing this?

@sultan99
Copy link

this helped me:

Sentry.init({
  . . .
  debug: false, // before it was true
})

@upschmidtcreek
Copy link

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.

@kamilogorek
Copy link
Contributor

kamilogorek commented Feb 25, 2020

@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.

@kamilogorek
Copy link
Contributor

kamilogorek commented Feb 25, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants