This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients christian.heimes, gvanrossum, sebastian, vinay.sajip
Date 2007-11-13.18:46:34
SpamBayes Score 0.029209072
Marked as misclassified No
Message-id <1194979595.09.0.988826890722.issue1436@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug: I think you are missing something. In the first
example (interactive usage), the lines "import logging" and "import
logging.handlers" do not magically introduce RotatingFileHandler into
your interactive session's globals. To do this, you would have to say
"from logging.handlers import RotatingFileHandler". An analogous example
unrelated to logging:

ActivePython 2.4.3 Build 12 (ActiveState Software Inc.) based on
Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> HTTP
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'HTTP' is not defined
>>> httplib.HTTP
<class httplib.HTTP at 0x00A759F0>
>>>

In the second example (using fileConfig), the documentation in

http://docs.python.org/lib/logging-config-fileformat.html

clearly states that the class and arguments are evaluated using the
logging package's namespace. This means that for a handler defined in
the logging package itself (such as StreamHandler) no qualification is
required, but for a handler defined in the handlers subpackage, you
should specify "handlers.RotatingFileHandler" in the configuration file
rather than "RotatingFileHandler" or "logging.handlers.RotatingFileHandler".
History
Date User Action Args
2007-11-13 18:46:35vinay.sajipsetspambayes_score: 0.0292091 -> 0.029209072
recipients: + vinay.sajip, gvanrossum, christian.heimes, sebastian
2007-11-13 18:46:35vinay.sajipsetspambayes_score: 0.0292091 -> 0.0292091
messageid: <1194979595.09.0.988826890722.issue1436@psf.upfronthosting.co.za>
2007-11-13 18:46:35vinay.sajiplinkissue1436 messages
2007-11-13 18:46:34vinay.sajipcreate