summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Zapke-Grùˆndemann <info@keimlink.de>2012-01-01 18:59:36 +0100
committerMarkus Zapke-Grùˆndemann <info@keimlink.de>2012-01-01 18:59:36 +0100
commita3239f592d5738801a4d8b6a0489fd564f816c96 (patch)
tree598839c68d6d06d6ef54530b480caeb6a2a3dc77
parent8458dcd6c26d47a3bbcb5dca9fc9ce856cad8204 (diff)
Added logging for development.
-rw-r--r--.gitignore1
-rw-r--r--conf/dev_settings.py9
-rw-r--r--sublab_project/settings.py12
3 files changed, 21 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 480e72e..02b42bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*.db
+*.log
*.pyc
*.swp
media
diff --git a/conf/dev_settings.py b/conf/dev_settings.py
index d5cefb7..1198968 100644
--- a/conf/dev_settings.py
+++ b/conf/dev_settings.py
@@ -1,6 +1,6 @@
import os
-from settings import SITE_ROOT, INSTALLED_APPS, MIDDLEWARE_CLASSES
+from settings import INSTALLED_APPS, LOGGING, MIDDLEWARE_CLASSES, SITE_ROOT
DEBUG = True
@@ -28,3 +28,10 @@ INTERNAL_IPS = ('127.0.0.1')
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}
+
+LOGGING['loggers'].update({
+ '': {
+ 'handlers': ['debuglog'],
+ 'level': 'DEBUG'
+ }
+})
diff --git a/sublab_project/settings.py b/sublab_project/settings.py
index a3d63e7..b748f3e 100644
--- a/sublab_project/settings.py
+++ b/sublab_project/settings.py
@@ -139,10 +139,22 @@ INSTALLED_APPS = (
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
+ 'formatters': {
+ 'simple': {
+ 'format': '%(levelname)s %(asctime)s %(pathname)s %(message)s'
+ }
+ },
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
+ },
+ 'debuglog': {
+ 'level': 'DEBUG',
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': os.path.join(SITE_ROOT, 'debug.log'),
+ 'maxBytes': 1000000,
+ 'formatter': 'simple'
}
},
'loggers': {