logger = logging.getLogger (__name__)
You are passing a name to getLogger
, so it is giving you a logger with the specified name (instead of the root logger, this is important later).
logging.info('Some log entry')
You are calling logging.info (note: very different from logger.info). logging.info
logs to the root logger. Which is a different entity than your logger
.
Either switch that call to logger.info('Some log entry')
or just get the root logger from logging.getLogger()
by not passing it a string.
Reading back over this I just used the word "logger" about 60 times in about as many contexts, so if this is confusing I can try to clarify.