Help me understand this logging config

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Sep 2 11:56:29 CEST 2011


On Aug 30, 1:39 pm, Roy Smith <r... at panix.com> wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compatibility for Python versions prior to 2.7.
>
> Comparing the django copy to lib/logging/config.py from Python 2.7.2,
> they're not identical.  It's likely they grabbed something earlier in
> the 2.7 series.  I'll check 2.7.0 and 2.7.1 to see.

They're not identical, but should be functionally equivalent. I'm not
able to reproduce your results: I copied the "loggers" part of your
config into a Django 1.3 project, and from a manage.py shell session:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import logging
>>> logger = logging.getLogger('djfront.auth.facebook')
>>> logger.debug('Debug')
>>> logger.info('Info')
2011-09-02 10:51:13,445 INFO     djfront.auth.facebook Info
>>>

... as expected.

Since it's Python 2.6, it should be using the dictconfig which ships
with Django 1.3.

Regards,

Vinay Sajip



More information about the Python-list mailing list