Rotating logs at midnight
This commit is contained in:
parent
25a6a6be22
commit
918ba0aa2b
@ -33,7 +33,7 @@ def _make_logger(name):
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.DEBUG)
|
||||
handler = logging.handlers.TimedRotatingFileHandler('%s.log' % name,
|
||||
when='h', interval=6, backupCount=4)
|
||||
when='midnight', interval=1, backupCount=3)
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
handler.setFormatter(formatter)
|
||||
log.addHandler(handler)
|
||||
|
Loading…
x
Reference in New Issue
Block a user