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

Double-printing text in django runserver_plus #1492

Closed
ajmath62 opened this issue Mar 27, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ajmath62
Copy link

commented Mar 27, 2019

On a Django project using django_extensions, using python manage.py runserver_plus with the latest werkzeug (v0.15.1) results in double-printing all logging statements. This is not an issue in v0.14.1; the issue arose in commit 4cf77d2. The reason for this issue is that runserver_plus modifies the werkzeug logger by setting its log level and adding a handler. Older versions of werkzeug only added a log handler if there was no log level and no handler on the root logger. Since that commit, werkzeug adds a log handler if there is no handler on the root logger, regardless of log level. This results in there being two handlers, and thus all logging statements get printed twice. If werkzeug checks for a handler on the werkzeug logger instead of the root logger, the second handler won't get added. Is there a reason to check the root logger for handlers, seeing as werkzeug doesn't use the root logger?

@davidism

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

See #1407 cc @ramnes

@davidism davidism self-assigned this Apr 2, 2019

@davidism davidism added this to the 0.15.2 milestone Apr 2, 2019

@davidism

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

Needs the same level check as pallets/flask#2436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.