from ConfigParser import SafeConfigParser
import glob
import logging
log = logging.getLogger()

INI=['view.ini', 'app.ini']
parser = None

def get_parser(ini=None):
    ''' make the config parser
    '''
    global parser

    try:
        if parser is None:
            candidates = []
            if ini is None: 
                ini = INI
            for i in ini:
                # add the .ini file and ./config/.ini file to our candidate file list
                candidates.append(i)
                candidates.append('./config/' + i)

            parser = SafeConfigParser()
            found = parser.read(candidates)
            logging.config.fileConfig(found)
    except:
        log.info("Couldn't find an acceptable ini file from {0}...".format(candidates))

    return parser


def get(id, def_val=None, section='view'):
    ''' get config value
    '''
    ret_val = def_val
    try:
        if get_parser():
            ret_val = get_parser().get(section, id)
            if ret_val is None:
                ret_val = def_val
    except:
        log.info("Couldn't find '{0}' in config under section '{1}'".format(id, section))

    return ret_val


def get_int(id, def_val=None, section='view'):
    ''' get config value as int (or go with def_val)
    '''
    ret_val = def_val
    try:
        v = get(id, def_val, section)
        if v:
            ret_val = int(v)
    except:
        log.info("Couldn't find int value '{0}' in config under section '{1}'".format(id, section))

    return ret_val

@@ -51,55 +51,55 @@
 lob%0A
-import logging%0Alog = logging.getLogger()%0A%0AINI=%5B
+%0AINI=%5B'app.ini', 'client.ini', 'services.ini', 
 'vie
@@ -107,19 +107,26 @@
 .ini', '
-app
+production
 .ini'%5D%0Ap
@@ -137,16 +137,33 @@
 r = None
+%0Afound_ini = None
 %0A%0Adef ge
@@ -175,20 +175,19 @@
 ser(ini=
-None
+INI
 ):%0A    '
@@ -237,16 +237,37 @@
 l parser
+%0A    global found_ini
 %0A%0A    tr
@@ -328,63 +328,8 @@
  %5B%5D%0A
-            if ini is None: %0A                ini = INI%0A
     
@@ -582,16 +582,20 @@
    found
+_ini
  = parse
@@ -617,53 +617,8 @@
 es)%0A
-            logging.config.fileConfig(found)%0A
     
@@ -734,16 +734,224 @@
 arser%0A%0A%0A
+def config_logger(ini=INI):%0A    try:%0A        get_parser(ini)%0A        import logging.config%0A        logging.config.fileConfig(found_ini, disable_existing_loggers=False)%0A    except Exception, e:%0A        pass%0A%0A%0A
 def get(

fix logging config in utils project...