mirror of https://github.com/JohnHammond/CTFd.git
Add fix for logrotation (#1311)
* Bump max log file size to 10 MB and fix log rotation on RotatingFileHandler * Closes #1302bulk-clear-sessions
parent
320feb9179
commit
aeab4ded6e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue