Skip to content
Snippets Groups Projects
Commit 783623be authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Create automatically logs dir

parent ccd0fb50
No related branches found
No related tags found
1 merge request!26Import surfaces
......@@ -5,3 +5,4 @@ playbook.retry
build
dist
.eggs
logs
......@@ -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': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment