My python application consists of main program and several modules. Each module contains
import logging
log = logging.getLogger('myapp.mymodule')
on global level. Handlers and other stuff initialized in main program, and typically all messages forwarded to syslog.
Now I want to launch multiple instances of application (configuration file with instance name can be specified as command line parameter). The question is: how to pass instance name to each imported module? I want logger name to look like 'myappinstance.mymodule' or 'myapp.instance.module'. And I do not want to mess with configuration file parsing in each module, because this will require hardcoded config path.