Opened 13 years ago

Closed 13 years ago

Last modified 13 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 by Adrien Lemaire, 13 years ago

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 by Adrien Lemaire, 13 years ago

Cc: lemaire.adrien@… added

in reply to:  1 comment:3 by Claude Paroz, 13 years ago

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 by Claude Paroz, 13 years ago

Resolution: fixed
Status: reopenedclosed

In [17741]:

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

comment:5 by Adrien Lemaire, 13 years ago

ah sorry for my mistake

comment:6 by Claude Paroz, 13 years ago

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