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

Respect configuration of specific logger when redirecting to std logging #293

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hongquan
Copy link

@hongquan hongquan commented Aug 1, 2019

Scenario:

  • My project is Django-based. I have 2 place to to consume logs: console and a cloud service.
  • I want log messages generated by a module to go to cloud service, not to console, so I configure a dict like this, in Django settings (LOGGING):
{
    'root': {
        'handlers': ['console', 'cloud']
    },
    'loggers': {
        'device': {
            'handlers': ['cloud']
        }
    }
}
  • Then I use logbook.compat.LoggingHandler to redirect my messages to standard logging.

The issue is that, all messages from device goes to console also. This PR is to fix that.

@coveralls
Copy link

coveralls commented Aug 1, 2019

Coverage Status

Coverage increased (+0.03%) to 76.881% when pulling 53dc356 on hongquan:bugfix/respect_specific into 185b9ed on getlogbook:develop.

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

Successfully merging this pull request may close these issues.

2 participants