Skip to content

Commit

Permalink
Added logs into Django for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryCarrade committed Apr 8, 2021
1 parent bd74bdb commit ed0d0af
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hawk/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
SECRET_KEY = config["secret_key"]

CONTENTS_DIR = Path(config.get("contents_dir", BASE_DIR / ".." / "hawk-data"))
LOGS_DIR = Path(config.get("logs_dir", CONTENTS_DIR / "logs"))

DATABASES = {
"default": {
Expand All @@ -41,6 +42,22 @@
pymysql.version_info = (2, 0, 3, "final", 0)
pymysql.install_as_MySQLdb()

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': LOGS_DIR / "django.log",
},
},
'root': {
'handlers': ['file'],
'level': 'DEBUG',
},
}

STATIC_ROOT = CONTENTS_DIR / "static"
MEDIA_ROOT = CONTENTS_DIR / "user-generated-content"
MAINTENANCE_MODE_STATE_FILE_PATH = CONTENTS_DIR / "maintenance"

0 comments on commit ed0d0af

Please sign in to comment.