diff --git a/.gitignore b/.gitignore index b3eb314b7859639b72827615c74570e53b13e38e..7c465bc5323fb49bcde6898ba2a7926fc640aee4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ playbook.retry build dist .eggs +logs diff --git a/arkindex/project/settings.py b/arkindex/project/settings.py index 301672791b38155787255ff229aa62c4d5fb80e1..4ac800ca5edf66fec3c017da0d7e080270ebf6b6 100644 --- a/arkindex/project/settings.py +++ b/arkindex/project/settings.py @@ -15,7 +15,9 @@ import logging # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - +LOGS_DIR = os.environ.get('LOGS_DIR', os.path.realpath(os.path.join(BASE_DIR, '../logs'))) +if not os.path.isdir(LOGS_DIR): + os.makedirs(LOGS_DIR) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ @@ -220,10 +222,7 @@ LOGGING = { 'level': 'INFO', 'class': 'logging.FileHandler', 'formatter': 'verbose', - 'filename': os.path.join( - os.environ.get('LOGS_DIR', os.path.realpath(os.path.join(BASE_DIR, '../../logs'))), - 'importers.log', - ) + 'filename': os.path.join(LOGS_DIR, 'importers.log'), }, }, 'loggers': {