Make log rotation also limited by size and controllable from settings. Resolves #2041

This commit is contained in:
Griatch 2020-01-29 23:16:53 +01:00
parent f124b3510b
commit ff16eb1bfe
13 changed files with 98 additions and 40 deletions

View file

@ -213,7 +213,8 @@ application = service.Application("Portal")
if "--nodaemon" not in sys.argv:
logfile = logger.WeeklyLogFile(
os.path.basename(settings.PORTAL_LOG_FILE), os.path.dirname(settings.PORTAL_LOG_FILE)
os.path.basename(settings.PORTAL_LOG_FILE), os.path.dirname(settings.PORTAL_LOG_FILE),
day_rotation=settings.PORTAL_LOG_DAY_ROTATION, max_size=settings.PORTAL_LOG_MAX_SIZE
)
application.setComponent(ILogObserver, logger.PortalLogObserver(logfile).emit)