This is my configuration file:
[loggers] keys=root [handlers] keys=TimedRotatingFileHandler [formatters] keys=simpleFormatter [logger_root] level=DEBUG handlers=TimedRotatingFileHandler [handler_TimedRotatingFileHandler] class=handlers.TimedRotatingFileHandler level=DEBUG formatter=simpleFormatter args=('driver.log', 'midnight', 1, 30) [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s datefmt=
In my code, I install and use the logger as follows:
import logging import logging.config logging.config.fileConfig('logging.conf') logging.info('Some message...')
Messages are logged in the file I specify (driver.log), but rotations at midnight never happen.
Should the process run at midnight to turn? This is a batch process that I run every 15 minutes and it never runs at midnight.
python logging
cope360
source share