Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

How to disable sentry on development environment? #538

Closed
cabello opened this issue Dec 12, 2014 · 8 comments
Closed

How to disable sentry on development environment? #538

cabello opened this issue Dec 12, 2014 · 8 comments

Comments

@cabello
Copy link

cabello commented Dec 12, 2014

Hi, I am using raven 3.6.0 for production and test environments however I don't need it sending exceptions and messages from my local development environment, how can I disable it and prevent this message from appearing on my shell or every time I call capture*:

Raven is not configured (logging is disabled). Please see the documentation for more information.
@dcramer
Copy link
Member

dcramer commented Dec 12, 2014

If you dont configure it it wont be enabled. That is, dont set the DSN value.

If you want to change logging, you can do that via your logging configuration.

@dcramer dcramer closed this as completed Dec 12, 2014
@cabello
Copy link
Author

cabello commented Dec 13, 2014

I checked the source code and if possible I could use a clarification on that, I saw:

def is_enabled(self):
        return bool(self.servers)

And also

if not self.is_enabled():
    self.logger.info(
            'Raven is not configured (logging is disabled). Please see the'
            ' documentation for more information.')

So I keep getting this message on my terminal. And I don't have the DSN value set do any value.

I guess the solution is to configure the logger to discard messages coming from raven?

@dcramer
Copy link
Member

dcramer commented Dec 13, 2014

Right. It shows that message when it's not sending messages. You just need to configure the logger with the standard mechanisms to disable it.

@mo-mughrabi
Copy link

Hello, not quite sure how to disable it from the logging, currently in the development env this message keeps popping and as developer, would like to find a way to hide it since in console I don't have use for it. Any advise on how todo that? am on django 1.8 and python 2.7

@dcramer
Copy link
Member

dcramer commented Aug 24, 2015

@mo-mughrabi we use the named logger 'raven' which can be configured using the standard logging package and tooling

@cabello
Copy link
Author

cabello commented Aug 24, 2015

Something like:

if DEBUG:
    LOGGING['loggers']['raven'] = {
        'handlers': ['null'],
        'level': 'ERROR',
    }

@mo-mughrabi
Copy link

+1 @cabello thanks

@xarg
Copy link

xarg commented Oct 4, 2015

I disabled the logging like so:

raven_logger = logging.getLogger('raven.base.Client')
raven_logger.setLevel(logging.CRITICAL)

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

No branches or pull requests

4 participants