Skip to content

Commit

Permalink
Fix error when log directory does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
raynei86 committed Jul 18, 2024
1 parent 66197ac commit 59704d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])),
Expand Down

1 comment on commit 59704d4

@raynei86
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message could've been more appropriately named "Create log directory when it does not exist", but it's too late now.

Please sign in to comment.