Both the Python logging module and CherryPy's Config API use ConfigParser files. Therefore, I assumed that I could use one single config file for my own applications configuration, it's logging configuration, and CherryPy's configuration.
When my logging and CherryPy were separate, they worked fine, and my config file does parse with no errors using the ConfigParser api. However, CherryPy seems to barf on this section:
[loggers]
keys=root,myapp,cherrypy,cperror,cpaccess
giving the following exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/multiprocessing/process.py", line 232, in _bootstrap
self.run()
File "/usr/lib/python2.6/multiprocessing/process.py", line 88, in run
self._target(*self._args, **self._kwargs)
File "unittests.py", line 431, in main
cherrypy.config.update(server.CONFIG_FILE)
File "/usr/lib/pymodules/python2.6/cherrypy/_cpconfig.py", line 263, in update
config = _Parser().dict_from_file(config)
File "/usr/lib/pymodules/python2.6/cherrypy/_cpconfig.py", line 383, in dict_from_file
return self.as_dict()
File "/usr/lib/pymodules/python2.6/cherrypy/_cpconfig.py", line 374, in as_dict
raise ValueError(msg, x.__class__.__name__, x.args)
ValueError: ("Config error in section: 'loggers', option: 'keys', value: 'root,myapp,cherrypy,cperror,cpaccess'. Config values must be valid Python.", 'TypeError', ("unrepr could not resolve the name 'root'",))
The CherryPy docs never say that CherryPy needs its config file to be separate from your other configuration, but I'm beginning to think that this might be necessary. The docs say that site and app configuration might need to be separate if you have more than one app per site, but that seems like a different issue... is it mistaking my logging configuration for a CherryPy app configuration?
Is this possible? If not, then I'm unsure why CherryPy even bothers using the ConfigParser library in the first place.