From: Thierry Parmentelat Date: Thu, 24 May 2018 13:00:56 +0000 (+0200) Subject: use time-rotating logs X-Git-Tag: sfa-4.0-0~23 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=479fe75aba4509060c663c0025dac7398269f7ff use time-rotating logs --- diff --git a/sfa/util/sfalogging.py b/sfa/util/sfalogging.py index a8f88f5c..e4b37c8a 100644 --- a/sfa/util/sfalogging.py +++ b/sfa/util/sfalogging.py @@ -155,14 +155,18 @@ def logging_config(context): 'file': { 'filename': filename, 'level': level, - # not using RotatingFileHandler for this first version - 'class': 'logging.FileHandler', 'formatter': 'standard', + 'class': 'logging.handlers.TimedRotatingFileHandler', + # every monday and during 3 months + 'when': 'w0', + 'interval': 1, + 'backupCount': 12, + }, 'stdout': { 'level': level, - 'class': 'logging.StreamHandler', 'formatter': 'standard', + 'class': 'logging.StreamHandler', }, }, 'loggers': {