Logging for staging, removed unused requirements.
[redakcja.git] / platforma / settings.py
index a116a44..0fb6518 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
-from os import path
+import os.path
 
-PROJECT_ROOT = path.realpath(path.dirname(__file__))
+PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
 
 DEBUG = False
 TEMPLATE_DEBUG = DEBUG
@@ -221,3 +221,19 @@ try:
 except ImportError:
     pass
 
+try:
+    LOGGING_CONFIG_FILE 
+except NameError:
+    LOGGING_CONFIG_FILE = os.path.join(PROJECT_ROOT, 
+                                ('logging.cfg' if not DEBUG else 'logging.cfg.dev'))
+
+try:
+    import logging
+    import logging.config
+
+    logging.config.fileConfig(LOGGING_CONFIG_FILE)    
+except ImportError, exc:
+    import traceback
+    traceback.print_exc()
+    raise
+