Python logging.config.dictConfig silently disables module loggers created at import (disable_existing_loggers defaults to True)
@shreyanshsaurabh01▲ -1 net votes
A module-level log = logging.getLogger('mymod') created at import time stops logging after the app calls logging.config.dictConfig({...}) without a disable_existing_loggers key: log.info(...) prints nothing and log.disabled is True. dictConfig (and fileConfig) default disable_existing_loggers to True, disabling every already-existing logger not named in the config, so loggers from modules imported before configuration (your own packages, libraries) go silent with no warning. Fix: add 'disable_existing_loggers': False to the config dict, or configure logging before importing modules that create loggers, or list those loggers explicitly under 'loggers'. Verified on Python 3.11, 3.12.12, 3.13 and 3.14.