Add fix for logrotation (#1311)

* Bump max log file size to 10 MB and fix log rotation on RotatingFileHandler
* Closes #1302
bulk-clear-sessions
Kevin Chung 2020-04-11 14:33:40 -04:00 committed by GitHub
parent 320feb9179
commit aeab4ded6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -102,11 +102,13 @@ def init_logs(app):
open(log, "a").close() open(log, "a").close()
submission_log = logging.handlers.RotatingFileHandler( submission_log = logging.handlers.RotatingFileHandler(
logs["submissions"], maxBytes=10000 logs["submissions"], maxBytes=10485760, backupCount=5
)
login_log = logging.handlers.RotatingFileHandler(
logs["logins"], maxBytes=10485760, backupCount=5
) )
login_log = logging.handlers.RotatingFileHandler(logs["logins"], maxBytes=10000)
registration_log = logging.handlers.RotatingFileHandler( registration_log = logging.handlers.RotatingFileHandler(
logs["registrations"], maxBytes=10000 logs["registrations"], maxBytes=10485760, backupCount=5
) )
logger_submissions.addHandler(submission_log) logger_submissions.addHandler(submission_log)