if pname != 'MainProcess':
    logging_config['handlers'] = {'h': {'level': 'INFO', 'formatter': 'f',
        'class': 'logging.FileHandler', 'filename': pname + '.log'}}
logging.config.dictConfig(logging_config)
configure_logging()

def pool_initializer():
    configure_logging()
n_cores = 4
pool = mp.Pool(n_cores, initializer=pool_initializer)
pool.map(do_log, list(range(100)))
pool.close()
pool.join()
How can I prevent the inheritance of python loggers and handlers during multiprocessing based on fork?