add log handlers

remotes/origin/HEAD
Max Yakovenko 8 years ago
parent b8600fe84c
commit 79a5317d6a
  1. 6
      eshop_project/settings/base.py
  2. 5
      eshop_project/settings/celery.py

@ -228,7 +228,7 @@ LOGGING = {
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler' 'class': 'django.utils.log.AdminEmailHandler'
}, },
'production_file': { 'prod_file_handler': {
'level': 'ERROR', 'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler', 'class': 'logging.handlers.RotatingFileHandler',
'filename': 'logs/eshop_main_prod.log', 'filename': 'logs/eshop_main_prod.log',
@ -237,7 +237,7 @@ LOGGING = {
'formatter': 'main_formatter', 'formatter': 'main_formatter',
'filters': ['require_debug_false'] 'filters': ['require_debug_false']
}, },
'debug_file': { 'debug_file_handler': {
'level': 'DEBUG', 'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler', 'class': 'logging.handlers.RotatingFileHandler',
'filename': 'logs/eshop_main_dev.log', 'filename': 'logs/eshop_main_dev.log',
@ -249,7 +249,7 @@ LOGGING = {
}, },
'loggers': { 'loggers': {
'django.request': { 'django.request': {
'handlers': ['mail_admins'], 'handlers': ['mail_admins','prod_file_handler' if DEBUG else 'debug_file_handler'],
'level': 'ERROR', 'level': 'ERROR',
'propagate': True 'propagate': True
} }

@ -5,3 +5,8 @@ CELERY_RESULT_BACKEND = env.str('CELERY_RESULT_BACKEND')
CELERY_ACCEPT_CONTENT = tuple(env.list("CELERY_ACCEPT_CONTENT")) CELERY_ACCEPT_CONTENT = tuple(env.list("CELERY_ACCEPT_CONTENT"))
CELERY_RESULT_SERIALIZER = env.str('CELERY_RESULT_SERIALIZER') CELERY_RESULT_SERIALIZER = env.str('CELERY_RESULT_SERIALIZER')
CELERY_TASK_SERIALIZER = env.str('CELERY_TASK_SERIALIZER') CELERY_TASK_SERIALIZER = env.str('CELERY_TASK_SERIALIZER')
if DEBUG:
CELERY_ALWAYS_EAGER = env.bool('CELERY_ALWAYS_EAGER')
CELERY_RDB_PORT = env.str('CELERY_RDB_PORT')
CELERY_RDBSIG=env.bool('CELERY_RDBSIG')

Loading…
Cancel
Save