files log config

Sun, 28 Jan 2018 12:00:18 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 28 Jan 2018 12:00:18 +0000
changeset 81
7bcd715f19e3
parent 80
a409242121d5
child 82
4e7678dd7b42

files log config

borgend/loggers.py file | annotate | diff | comparison | revisions
--- a/borgend/loggers.py	Sun Jan 28 11:54:46 2018 +0000
+++ b/borgend/loggers.py	Sun Jan 28 12:00:18 2018 +0000
@@ -19,6 +19,12 @@
 logfmt="%(asctime)s:%(levelname)s:%(name)s:%(message)s"
 fifo_capacity=1000
 fifo_fmt="%(asctime)s:%(levelname)s:%(message)s"
+fileslog_config={
+    'when': 'midnight',
+    'interval': 1,
+    'backupCount': 7
+    }
+
 
 #
 # Setting up the main logger with fifo, stderr, and rotating files output
@@ -46,7 +52,7 @@
 
 fileslog=logging.handlers.TimedRotatingFileHandler(
     os.path.join(locations.logs_dir, branding.appname+'.log'),
-    when='D', interval=1)
+    **fileslog_config)
 fileslog.setFormatter(logging.Formatter(logfmt))
 mainlogger.addHandler(fileslog)
 

mercurial