﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23569	settings.LOGGING_CONFIG assumes dictConfig()	Seth Hill	nobody	"It seems that if you set the LOGGING_CONFIG settings var to fileConfig(), django breaks. 

It seems like the intention here is to create a set of default logging configurations, and then allow the user to override them. That seems like a good idea, except the DEFAULT_LOGGING variable is a dict, which is passed into the user-defined logging_config_func. So it seems like only dictConfig() is allowed. 

The trouble spot seems to be in django/utils/log.py:76: 

{{{
    if logging_config:
        # First find the logging configuration function ...
        logging_config_func = import_string(logging_config)

        logging_config_func(DEFAULT_LOGGING)

        # ... then invoke it with the logging settings
        if logging_settings:
            logging_config_func(logging_settings)
}}}


I think this should be something like: 

{{{
    if logging_config:
        # First find the logging configuration function ...
        logging_config_func = import_string(logging_config)

        dictConfig(DEFAULT_LOGGING)

        # ... then invoke it with the logging settings
        if logging_settings:
            logging_config_func(logging_settings)
}}}



In my case, I have defined 

{{{
LOGGING_CONFIG = 'logging.config.fileConfig'
LOGGING = '/path/to/ini_file'
}}}

Which results in an obscure ConfigParser.NoSectionError: No section: 'formatters', as the fileConfig() is trying to use a ConfigParser to read a dictionary. 



"	Bug	closed	Core (Other)	1.7	Normal	fixed			Accepted	1	0	0	0	0	0
