diff --git a/orm/base_config.py b/orm/base_config.py index c4514b55..81a7ca26 100644 --- a/orm/base_config.py +++ b/orm/base_config.py @@ -33,7 +33,10 @@ OrmOpts = [ help='Flag for SSL verfiy Enabled/Disabled.'), cfg.StrOpt('log_location', default='/var/log/ranger', - help='Orm log directory.') + help='Orm log directory.'), + cfg.StrOpt('debug_level', + default='DEBUG', + help='logging debug level') ] CONF.register_opts(OrmOpts) @@ -225,6 +228,7 @@ CONF.register_opts(OrmCliGroup, orm_cli_group) # referenced to them. ################################################################ +debug_level = CONF.debug_level protocol = CONF.protocol orm_host = CONF.orm_host ranger_base = CONF.ranger_base diff --git a/orm/services/audit_trail_manager/config.py b/orm/services/audit_trail_manager/config.py index ae40845b..b0ec6436 100644 --- a/orm/services/audit_trail_manager/config.py +++ b/orm/services/audit_trail_manager/config.py @@ -23,21 +23,24 @@ app = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'audit_server': {'level': 'DEBUG', 'handlers': ['console', 'logfile'], - 'propagate': False}, - 'pecan': {'level': 'DEBUG', 'handlers': ['console'], + 'orm.services.audit_trail_manager.audit_server': { + 'level': config.debug_level, + 'handlers': ['console', 'logfile'], + 'propagate': False + }, + 'pecan': {'level': config.debug_level, 'handlers': ['console'], 'propagate': False}, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.FileHandler', 'formatter': 'color', 'filename': config.audit_server['log'] diff --git a/orm/services/customer_manager/config.py b/orm/services/customer_manager/config.py index 3b64ed8d..37661855 100755 --- a/orm/services/customer_manager/config.py +++ b/orm/services/customer_manager/config.py @@ -26,24 +26,37 @@ app = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'cms_rest': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'keystone_utils': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'pecan': {'level': 'DEBUG', 'handlers': ['console'], 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'keystone_utils': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'audit_client': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, + 'orm.services.customer_manager.cms_rest': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'orm.common.orm_common': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'orm.common.client.keystone.keystone_utils': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'pecan': {'level': 'DEBUG', 'handlers': ['console'], + 'propagate': False}, + 'orm.common.client.audit.audit_client': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'Logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 50000000, 'backupCount': 10, diff --git a/orm/services/flavor_manager/config.py b/orm/services/flavor_manager/config.py index ed2c5247..f6a236bc 100755 --- a/orm/services/flavor_manager/config.py +++ b/orm/services/flavor_manager/config.py @@ -26,22 +26,36 @@ app = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'fms_rest': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, + 'orm.services.flavor_manager.fms_rest': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, 'pecan': {'level': 'DEBUG', 'handlers': ['console'], 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'keystone_utils': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'audit_client': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, + 'orm.common.orm_common': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'orm.common.client.keystone.keystone_utils': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'orm.common.client.audit.audit_client': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'Logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 50000000, 'backupCount': 10, diff --git a/orm/services/id_generator/config.py b/orm/services/id_generator/config.py index fea2c78b..0a50fb88 100755 --- a/orm/services/id_generator/config.py +++ b/orm/services/id_generator/config.py @@ -13,6 +13,48 @@ app = { 'debug': True, } +logging = { + 'root': {'level': 'INFO', 'handlers': ['console']}, + 'loggers': { + 'orm.services.id_generator.uuidgen': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'pecan': {'level': config.debug_level, 'handlers': ['console'], + 'propagate': False}, + 'py.warnings': {'handlers': ['console']}, + '__force_dict__': True + }, + 'handlers': { + 'console': { + 'level': config.debug_level, + 'class': 'logging.StreamHandler', + 'formatter': 'color' + }, + 'Logfile': { + 'level': config.debug_level, + 'class': 'logging.handlers.RotatingFileHandler', + 'maxBytes': 50000000, + 'backupCount': 10, + 'filename': config.uuid['log'], + 'formatter': 'simple' + } + }, + 'formatters': { + 'simple': { + 'format': ('%(asctime)s %(levelname)-5.5s [%(name)s]' + '[%(threadName)s] %(message)s') + }, + 'color': { + '()': 'pecan.log.ColorFormatter', + 'format': ('%(asctime)s [%(padded_color_levelname)s] [%(name)s]' + '[%(threadName)s] %(message)s'), + '__force_dict__': True + } + } +} + verify = config.ssl_verify database = { 'connection_string': config.db_url + 'orm' diff --git a/orm/services/image_manager/config.py b/orm/services/image_manager/config.py index f51d2c67..0516322f 100755 --- a/orm/services/image_manager/config.py +++ b/orm/services/image_manager/config.py @@ -24,25 +24,29 @@ app = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'ims': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'audit_client': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'pecan': {'level': 'DEBUG', 'handlers': ['console'], + 'orm.services.image_manager.ims': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'orm.common.client.audit.audit_client': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'orm.common.orm_common': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'pecan': {'level': config.debug_level, 'handlers': ['console'], 'propagate': False}, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'Logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 50000000, 'backupCount': 10, diff --git a/orm/services/region_manager/config.py b/orm/services/region_manager/config.py index e5084c8b..1c310576 100755 --- a/orm/services/region_manager/config.py +++ b/orm/services/region_manager/config.py @@ -24,28 +24,37 @@ app = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'rms': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'pecan': {'level': 'DEBUG', 'handlers': ['console'], + 'orm.services.region_manager.rms': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'pecan': {'level': config.debug_level, 'handlers': ['console'], 'propagate': False}, - 'audit_client': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], - 'propagate': False}, - 'keystone_utils': {'level': 'DEBUG', - 'handlers': ['console', 'Logfile'], - 'propagate': False}, + 'orm.common.client.audit.audit_client': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'orm.common.orm_common': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'orm.common.client.keystone.keystone_utils': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'Logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 50000000, 'backupCount': 10, diff --git a/orm/services/resource_distributor/config.py b/orm/services/resource_distributor/config.py index 272f9745..d213ea97 100755 --- a/orm/services/resource_distributor/config.py +++ b/orm/services/resource_distributor/config.py @@ -158,21 +158,32 @@ region_resource_id_status = { logging = { 'root': {'level': 'INFO', 'handlers': ['console']}, 'loggers': { - 'rds': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'orm_common': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'audit_client': {'level': 'DEBUG', 'handlers': ['console', 'Logfile'], 'propagate': False}, - 'pecan': {'level': 'DEBUG', 'handlers': ['console'], 'propagate': False}, + 'orm.services.resource_distributor.rds': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'orm.common.orm_common': {'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False}, + 'orm.common.client.audit.audit_client': { + 'level': config.debug_level, + 'handlers': ['console', 'Logfile'], + 'propagate': False + }, + 'pecan': {'level': config.debug_level, + 'handlers': ['console'], 'propagate': False}, 'py.warnings': {'handlers': ['console']}, '__force_dict__': True }, 'handlers': { 'console': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.StreamHandler', 'formatter': 'color' }, 'Logfile': { - 'level': 'DEBUG', + 'level': config.debug_level, 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 50000000, 'backupCount': 10,