Commits

Marcin Kuzminski committed 04d2616

Whoosh logging is now controlled by the .ini files logging setup

  • Participants
  • Parent commits df96adc

Comments (0)

Files changed (5)

 
 beaker.session.type = file
 beaker.session.key = rhodecode
+# secure cookie requires AES python libraries
 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
 #beaker.session.validate_key = 9712sds2212c--zxc123
 beaker.session.timeout = 36000
 ### LOGGING CONFIGURATION   ####
 ################################
 [loggers]
-keys = root, routes, rhodecode, sqlalchemy, beaker, templates
+keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
 
 [handlers]
 keys = console, console_sql
 qualname = sqlalchemy.engine
 propagate = 0
 
+[logger_whoosh_indexer]
+level = DEBUG
+handlers = 
+qualname = whoosh_indexer
+propagate = 1
+
 ##############
 ## HANDLERS ##
 ##############
 ### LOGGING CONFIGURATION   ####
 ################################
 [loggers]
-keys = root, routes, rhodecode, sqlalchemy, beaker, templates
+keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
 
 [handlers]
 keys = console, console_sql
 qualname = sqlalchemy.engine
 propagate = 0
 
+[logger_whoosh_indexer]
+level = DEBUG
+handlers = 
+qualname = whoosh_indexer
+propagate = 1
+
 ##############
 ## HANDLERS ##
 ##############

rhodecode/config/deployment.ini_tmpl

 ### LOGGING CONFIGURATION   ####
 ################################
 [loggers]
-keys = root, routes, rhodecode, sqlalchemy, beaker, templates
+keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
 
 [handlers]
 keys = console, console_sql
 qualname = sqlalchemy.engine
 propagate = 0
 
+[logger_whoosh_indexer]
+level = DEBUG
+handlers = 
+qualname = whoosh_indexer
+propagate = 1
+
 ##############
 ## HANDLERS ##
 ##############

rhodecode/lib/indexers/__init__.py

 import os
 import sys
 import traceback
+import logging
 from os.path import dirname as dn, join as jn
 
 #to get the rhodecode import
     parser = Command.standard_parser(verbose=True)
 
     def command(self):
-
+        logging.config.fileConfig(self.path_to_ini_file)
         from pylons import config
         add_cache(config)
         engine = engine_from_config(config, 'sqlalchemy.db1.')

rhodecode/lib/utils.py

         """
         from pylons import config as pylonsconfig
 
-        path_to_ini_file = os.path.realpath(conf)
-        conf = paste.deploy.appconfig('config:' + path_to_ini_file)
+        self.path_to_ini_file = os.path.realpath(conf)
+        conf = paste.deploy.appconfig('config:' + self.path_to_ini_file)
         pylonsconfig.init_app(conf.global_conf, conf.local_conf)