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

Log & Error Notifiers are printing logs even after turning them off #32

Open
hardvain opened this issue May 14, 2020 · 1 comment
Open

Comments

@hardvain
Copy link

hardvain commented May 14, 2020

I have turned off logging by setting NPLUSONE_LOG=False and NPLUSONE_RAISE=False in my settings file. Still I see that the logs are being printed. This is happening in local env where I run the django app with Debug=True

Is there a way to silence the logs from the notifier even when running the app in debug mode?

@hartwork
Copy link

I've had a closer look at the code of why this would be happening. If we follow the code, we get this path:

  • NPlusOneMiddleware.__init__
  • NPlusOneMiddleware.process_request
    • NPlusOneMiddleware.load_config
      • nplusone.core.notifiers.init(vars(settings._wrapped)) !!!
        • LogNotifier.is_enabled
          • Notifier.is_enabled
            • settings.NPLUSONE_LOG
        • ErrorNotifier.is_enabled
          • Notifier.is_enabled
            • settings.NPLUSONE_RAISE

With that view, I don't see why you would still get messages printed. Can you rule out that your running an earlier built of a Docker image or something? How far did you go with debugging things in your environment?

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

No branches or pull requests

2 participants