Add django file logging for stage
This commit is contained in:
parent
e3d266e539
commit
46502c164a
|
@ -1,4 +1,7 @@
|
|||
#!/bin/sh
|
||||
python /app/manage.py collectstatic --noinput
|
||||
python /app/manage.py compilescss
|
||||
mkdir /var/log/gunicorn/
|
||||
chown -R root:django /var/log/gunicorn/
|
||||
chmod -R 770 /var/log/gunicorn/
|
||||
/usr/local/bin/gunicorn config.wsgi -w 4 -b unix:/data/sockets/gunicorn.sock --error-logfile /var/log/gunicorn/gunicorn-error.log --chdir=/app
|
||||
|
|
|
@ -195,6 +195,11 @@ LOGGING = {
|
|||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'verbose',
|
||||
},
|
||||
'logfile': {
|
||||
'level':'DEBUG',
|
||||
'class':'logging.FileHandler',
|
||||
'filename': BASE_DIR + "/../logfile",
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
'django.request': {
|
||||
|
@ -204,7 +209,7 @@ LOGGING = {
|
|||
},
|
||||
'django.security.DisallowedHost': {
|
||||
'level': 'ERROR',
|
||||
'handlers': ['console', 'mail_admins'],
|
||||
'handlers': ['logfile', 'console', 'mail_admins'],
|
||||
'propagate': True
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue