(continued from previous page) where$_{project.util}$ can be replaced with the actual name of the package where the function resides. In the above working script, using$_{'ext://__main__.owned_file_handler'}$ should work. Here, the actual callable is resolved by$_{dictConfig()}$ from the$_{ext://}$ specification. This example hopefully also points the way to how you could implement other types of file change - e.g. setting specific POSIX permission bits - in the same way, using$_{os.chmod()}$ . Of course, the approach could also be extended to types of handler other than a$_{FileHandler}$ - for example, one of the rotating file handlers, or a different type of handler altogether. 31 you could use e.g.: '() ':'ext://project.util.owned_file_handler ', '() ': owned_file_handler, In practice, the handler-creating function may be in a utility module somewhere in your project. Instead of the line in the configuration: Note that this example uses Python 3.3 because that’s where$_{shutil.chown()}$ makes an appearance. This ap- proach should work with any Python version that supports$_{dictConfig()}$ - namely, Python 2.7, 3.2 or later. With pre-3.3 versions, you would need to implement the actual ownership change using e.g.$_{os.chown()}$ . To run this, you will probably need to run as$_{root}$: $ sudo python3.3 chowntest.py $ cat chowntest.log 2013-11-05 09:34:51,128 DEBUG mylogger A debug message $ ls -l chowntest.log -rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log 'disable_existing_loggers ': False , 'formatters': { 'default': { 'format':' %(asctime)s %(levelname)s %(name)s %(message)s ' }, }, 'handlers': { 'file':{ # The values below are popped from this dictionary and # used to create the handler, set the handler's level and # its formatter. '() ': owned_file_handler, 'level ':'DEBUG', 'formatter':'default', # The values below are passed to the handler creator callable # as keyword arguments. 'owner': ['pulse','pulse'], 'filename':'chowntest.log ', 'mode':'w', 'encoding':'utf-8 ', }, }, 'root': { 'handlers': ['file'], 'level ':'DEBUG', }, } logging.config.dictConfig(LOGGING) logger=logging.getLogger('mylogger') logger.debug( 'A debug message')