diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-28 11:11:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-28 11:11:59 +0200 |
commit | b3de02632568b4e65cbe96387e57506077c66ed8 (patch) | |
tree | 3fbe8fec42859efb57c548542a92e2fe3bb7a07a | |
parent | 91dab4b1d99bb205fec5c60ab790f547dac605f1 (diff) | |
download | Ishtar-b3de02632568b4e65cbe96387e57506077c66ed8.tar.bz2 Ishtar-b3de02632568b4e65cbe96387e57506077c66ed8.zip |
Change default logging conf
-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') |