From df77cac47871951916935be929732fb42548276b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Mart=C3=ADn?= Date: Thu, 23 May 2013 13:02:19 +0200 Subject: [PATCH] Deploy fixes: supervisor script execution, local settings for logging with raven and logging disabled on main settings --- config/production/app.supervisor.conf | 2 +- config/production/local_settings.py | 43 +++++++++++++++++++++++++++ minecraftcodex/herobrine/settings.py | 14 --------- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/config/production/app.supervisor.conf b/config/production/app.supervisor.conf index 915bf0c..0070050 100644 --- a/config/production/app.supervisor.conf +++ b/config/production/app.supervisor.conf @@ -1,5 +1,5 @@ [program:gunicorn] -command = /home/app/virtualenv/bin/python /home/app/app/manage.py run_gunicorn -w 4 -k gevent +command = /home/app/virtualenv/bin/python2 /home/app/app/manage.py run_gunicorn --settings=herobrine.local_settings -w 2 directory = /home/app/app user = app autostart = true diff --git a/config/production/local_settings.py b/config/production/local_settings.py index c988830..25c9056 100644 --- a/config/production/local_settings.py +++ b/config/production/local_settings.py @@ -40,3 +40,46 @@ INSTALLED_APPS = INSTALLED_APPS + ( 'raven.contrib.django.raven_compat', 'gunicorn' ) + +# Logging +LOGGING = { + 'version': 1, + 'disable_existing_loggers': True, + 'root': { + 'level': 'WARNING', + 'handlers': ['sentry'], + }, + 'formatters': { + 'verbose': { + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' + }, + }, + 'handlers': { + 'sentry': { + 'level': 'ERROR', + 'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', + }, + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'verbose' + } + }, + 'loggers': { + 'django.db.backends': { + 'level': 'ERROR', + 'handlers': ['console'], + 'propagate': False, + }, + 'raven': { + 'level': 'DEBUG', + 'handlers': ['console'], + 'propagate': False, + }, + 'sentry.errors': { + 'level': 'DEBUG', + 'handlers': ['console'], + 'propagate': False, + }, + }, +} diff --git a/minecraftcodex/herobrine/settings.py b/minecraftcodex/herobrine/settings.py index ef4de9f..90d306a 100644 --- a/minecraftcodex/herobrine/settings.py +++ b/minecraftcodex/herobrine/settings.py @@ -143,20 +143,6 @@ JINJA_CONFIG = { } #from herobrine import filters -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error when DEBUG=False. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - } -} try: LOCAL_SETTINGS