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?
On a Django project using
django_extensions, usingpython manage.py runserver_pluswith the latestwerkzeug(v0.15.1) results in double-printing all logging statements. This is not an issue inv0.14.1; the issue arose in commit 4cf77d2. The reason for this issue is thatrunserver_plusmodifies thewerkzeuglogger by setting its log level and adding a handler. Older versions ofwerkzeugonly added a log handler if there was no log level and no handler on the root logger. Since that commit,werkzeugadds 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. Ifwerkzeugchecks for a handler on thewerkzeuglogger instead of the root logger, the second handler won't get added. Is there a reason to check the root logger for handlers, seeing aswerkzeugdoesn't use the root logger?