diff options
| -rw-r--r-- | example_project/settings.py | 29 | 
1 files changed, 20 insertions, 9 deletions
| diff --git a/example_project/settings.py b/example_project/settings.py index 128befe5a..9c4d5c9c3 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -155,6 +155,12 @@ INSTALLED_APPS = [  LOGFILE = '' +default_handler = { +    'handlers': ['logfile'], +    'level': 'INFO', +    'propogate': False +} +  LOGGING = {      'version': 1,      'disable_existing_loggers': False, @@ -178,24 +184,24 @@ LOGGING = {          },      },      'loggers': { -        # Again, default Django configuration to email unhandled exceptions          'django.request': { -            'handlers': ['mail_admins'], +            'handlers': ['mail_admins', 'logfile'],              'level': 'ERROR',              'propagate': True,          }, -        # Might as well log any errors anywhere else in Django          'django': {              'handlers': ['logfile'],              'level': 'ERROR',              'propagate': False,          }, -        # Your own app - this assumes all your logger names start with "myapp." -        'chimere': { -            'handlers': ['logfile'], -            'level': 'WARNING',  # Or maybe INFO or DEBUG -            'propogate': False -        }, +        'ishtar_pdl': default_handler, +        'ishtar_common': default_handler, +        'archaeological_files_pdl': default_handler, +        'archaeological_files': default_handler, +        'archaeological_operations': default_handler, +        'archaeological_context_records': default_handler, +        'archaeological_warehouse': default_handler, +        'archaeological_finds': default_handler,      },  } @@ -243,6 +249,11 @@ INTERNAL_IPS = ('127.0.0.1',)  JQUERY_URL = STATIC_URL + "js/jquery.min.js"  JQUERY_UI_URL = STATIC_URL + "js/jquery-ui/" +if DEBUG: +    # make all loggers use the console +    for logger in LOGGING['loggers']: +        LOGGING['loggers'][logger]['handlers'] += ['console'] +  if DJANGO_EXTENSIONS:      INSTALLED_APPS.append('django_extensions') | 
