ConfigParser.NoSectionError: No section: 'forma...

source code:

logging.config.fileConfig(“/etc/quantum/logging.conf”)

error message:

File “F:\workspace\Network Server\nsoclient\common\client_utils
.py”, line 18, in

logging.config.fileConfig("/etc/quantum/logging.conf")

File “C:\Python27\lib\logging\config.py”, line 70, in fileConfig

formatters = _create_formatters(cp)

File “C:\Python27\lib\logging\config.py”, line 106, in _create_formatters

flist = cp.get("formatters", "keys")

File “C:\Python27\lib\ConfigParser.py”, line 607, in get

raise NoSectionError(section)

ConfigParser.NoSectionError: No section: 'formatters'

reason:

The reason the 'formatters' is missing , is because the logging module can't load the relative file path '/etc/quantum/logging.conf' in windows. So correct way is absolute file path ' c:\etc\quantum\logging.conf '

revise code:

logging.config.fileConfig(“c:\etc\quantum\logging.conf”)

你可能感兴趣的:(ConfigParser.NoSectionError: No section: 'forma...)