From 59704d4e4d809b2b3316b322c7c20f843a053c3d Mon Sep 17 00:00:00 2001 From: Lihui Zhang Date: Thu, 18 Jul 2024 10:24:44 -0400 Subject: [PATCH] Fix error when log directory does not exist --- app/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/__init__.py b/app/__init__.py index 6e2d06ecd..c893ba8c7 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -83,6 +83,7 @@ def create_app(config_name='default'): ''')) app.logger.addHandler(mail_handler) + os.makedirs(app.config['LOGFILE_DIRECTORY'], exist_ok=True) handler_error = TimedRotatingFileHandler( os.path.join(app.config['LOGFILE_DIRECTORY'], 'openrecords_{}_error.log'.format(app.config['APP_VERSION_STRING'])),