Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#17900 closed Bug (fixed)

Logging Primer misrepresents the StreamHandler

Reported by: c4m3lo Owned by: nobody
Component: Documentation Version: 1.4-beta-1
Severity: Normal Keywords:
Cc: lemaire.adrien@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The Django Logging Primer says that logging.StreamHandler outputs to stdout. This is at odds with the Python documentation for the class, which says that it goes to sys.stderr.

Change History (6)

comment:1 Changed 5 years ago by Adrien Lemaire

Resolution: invalid
Status: newclosed

Effectively, the doc says:

Returns a new instance of the StreamHandler class. If stream is specified, the instance will use it for
logging output; otherwise, sys.stderr will be used.

But django always specifies a stream to handler, thus logging.StreamHandler outputs to stdout.
You can have a look at django.utils.dictconfig.py DictConfigurator.configure_handler() , from line 491 to 501.

comment:2 Changed 5 years ago by Adrien Lemaire

Cc: lemaire.adrien@… added

comment:3 in reply to:  1 Changed 5 years ago by Claude Paroz

Resolution: invalid
Status: closedreopened
Triage Stage: UnreviewedAccepted

Replying to Fandekasp:

But django always specifies a stream to handler, thus logging.StreamHandler outputs to stdout.
You can have a look at django.utils.dictconfig.py DictConfigurator.configure_handler() , from line 491 to 501.

Sorry, but that is not true. By default, no kwargs are provided to the handler class constructor, so the default is stderr. The docs have to be fixed.

comment:4 Changed 5 years ago by Claude Paroz

Resolution: fixed
Status: reopenedclosed

In [17741]:

Fixed #17900 -- StreamHandler output defaults to stderr. Thanks c4m3lo for the report.

comment:5 Changed 5 years ago by Adrien Lemaire

ah sorry for my mistake

comment:6 Changed 5 years ago by Claude Paroz

In [17742]:

[1.3.X] Fixed #17900 -- StreamHandler output defaults to stderr. Thanks c4m3lo for the report.

Backport of r17741 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top