I set this up 3 days ago and have not seen any of the logs I've
created this way being rotated. I expected them to rotate every
midnight. I'm calling the code that uses this logger many times, each
a separate run, if that matters.
Am I doing something stupid? I can't find anything on google and don't
see anything in the code that would prevent rotating.
Thanks.
import logging, logging.handler s
logging.getLogg er().setLevel(l ogging.DEBUG) # override default of WARNING
logfile = logging.handler s.TimedRotating FileHandler(fil ename, 'midnight', 1, backupCount=14)
logfile.setLeve l(logging.DEBUG )
logfile.setForm atter(logging.F ormatter('%(asc time)s %(levelname)-8s %(module)s: %(message)s'))
logging.getLogg er().addHandler (logfile)
created this way being rotated. I expected them to rotate every
midnight. I'm calling the code that uses this logger many times, each
a separate run, if that matters.
Am I doing something stupid? I can't find anything on google and don't
see anything in the code that would prevent rotating.
Thanks.
import logging, logging.handler s
logging.getLogg er().setLevel(l ogging.DEBUG) # override default of WARNING
logfile = logging.handler s.TimedRotating FileHandler(fil ename, 'midnight', 1, backupCount=14)
logfile.setLeve l(logging.DEBUG )
logfile.setForm atter(logging.F ormatter('%(asc time)s %(levelname)-8s %(module)s: %(message)s'))
logging.getLogg er().addHandler (logfile)
Comment