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

Debug toolbar's ThreadTrackingHandler mutes Daphne errors #1300

Closed
JulienPalard opened this issue Jul 15, 2020 · 3 comments
Closed

Debug toolbar's ThreadTrackingHandler mutes Daphne errors #1300

JulienPalard opened this issue Jul 15, 2020 · 3 comments

Comments

@JulienPalard
Copy link

JulienPalard commented Jul 15, 2020

In a "basic" setup, with django/channels, django/daphne, and debug-toolbar installed, and no specific configuration, Daphne logs are lost. I take daphne as an example, but any application or library not logging under the django namespace are lost the same (but could be displayed in the debug toolbar).

This is because we're relying, maybe too much, on the lastResort logger to log messages to stderr for any unconfigured logging namespace.

As debug-toolbar installs its ThreadTrackingHandler to the root logger, messages are considered handled by the logging module, which does not use the lastResort logger to log them to stdout: messages are not displayed (and while I'm in a websocket handler, I have no debug toolbar to display them to me).

@medihack
Copy link

I also can confirm this. The issue is resolved by commenting out the LoggingPanel.

DEBUG_TOOLBAR_PANELS = [
    "debug_toolbar.panels.versions.VersionsPanel",
    "debug_toolbar.panels.timer.TimerPanel",
    "debug_toolbar.panels.settings.SettingsPanel",
    "debug_toolbar.panels.headers.HeadersPanel",
    "debug_toolbar.panels.request.RequestPanel",
    "debug_toolbar.panels.sql.SQLPanel",
    "debug_toolbar.panels.staticfiles.StaticFilesPanel",
    "debug_toolbar.panels.templates.TemplatesPanel",
    "debug_toolbar.panels.cache.CachePanel",
    "debug_toolbar.panels.signals.SignalsPanel",
    # Does not work with Django Channels, see
    # https://github.com/django/channels/issues/1204
    # "debug_toolbar.panels.logging.LoggingPanel",
    "debug_toolbar.panels.redirects.RedirectsPanel",
    "debug_toolbar.panels.profiling.ProfilingPanel",
]

Unfortunately, the following does NOT work:

DEBUG_TOOLBAR_CONFIG = {
    "DISABLE_PANELS": [
        'debug_toolbar.panels.logging.LoggingPanel',
    ]
}

dimadk24 added a commit to dimadk24/english-fight that referenced this issue Feb 15, 2021
Doesn't play nice with django channels
Silences exceptions in consumers
See:
django/channels#1340
django/channels#1193
django-commons/django-debug-toolbar#1300
dimadk24 added a commit to dimadk24/english-fight that referenced this issue Feb 16, 2021
Doesn't play nice with django channels
Silences exceptions in consumers
See:
django/channels#1340
django/channels#1193
django-commons/django-debug-toolbar#1300
dimadk24 added a commit to dimadk24/english-fight that referenced this issue Mar 7, 2021
Doesn't play nice with django channels
Silences exceptions in consumers
See:
django/channels#1340
django/channels#1193
django-commons/django-debug-toolbar#1300
dimadk24 added a commit to dimadk24/english-fight that referenced this issue Mar 11, 2021
Doesn't play nice with django channels
Silences exceptions in consumers
See:
django/channels#1340
django/channels#1193
django-commons/django-debug-toolbar#1300
@tim-schilling
Copy link
Member

I'm closing this as closed in #1603. @medihack @JulienPalard, if that's not the case, please let me know.

@matthiask
Copy link
Member

Thanks, I agree. Besides, if the bug is still there it would come up again.

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

4 participants