update config.py.tmpl and ldt
authorymh <ymh.work@gmail.com>
Thu, 07 Feb 2013 13:52:53 +0100
changeset 120 72be7f52c743
parent 119 e40392f60149
child 121 120ffd82d3a7
update config.py.tmpl and ldt
src/theend/config.py.tmpl
virtualenv/res/src/ldt.tar.gz
--- a/src/theend/config.py.tmpl	Thu Feb 07 11:34:06 2013 +0100
+++ b/src/theend/config.py.tmpl	Thu Feb 07 13:52:53 2013 +0100
@@ -64,7 +64,61 @@
 #LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
 LOG_FILE = '%(log_file)s'
 LOG_LEVEL = logging.DEBUG
-logging.basicConfig(filename=LOG_FILE, level=LOG_LEVEL)
+LOGGING = {
+    'version': 1,
+    'disable_existing_loggers': False,
+    'filters': {
+        'require_debug_false': {
+            '()': 'django.utils.log.RequireDebugFalse'
+        }
+    },
+    'formatters' : {
+        'simple' : {
+            'format': "%(asctime)s - %(levelname)s : %(message)s",
+        },
+        'semi-verbose': {
+            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
+        },                    
+    },
+    'handlers': {
+        'mail_admins': {
+            'level': 'ERROR',
+            'class': 'django.utils.log.AdminEmailHandler'
+        },
+        'stream_to_console': {
+            'level': LOG_LEVEL,
+            'class': 'logging.StreamHandler'
+        },
+        'file': {
+            'level': LOG_LEVEL,
+            'class': 'logging.FileHandler',
+            'filename': LOG_FILE,
+            'formatter': 'semi-verbose',
+        },
+    },
+    'loggers': {
+        'django.db.backends':{
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },                
+        'django.request': {
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },
+        'ldt': {
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },
+        'theend': {
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },
+    }
+}
 
 
 ADMINS = (
Binary file virtualenv/res/src/ldt.tar.gz has changed