diff --git a/etc/glance-api.conf b/etc/glance-api.conf index 4de3c72d5d..1ed0aabb21 100644 --- a/etc/glance-api.conf +++ b/etc/glance-api.conf @@ -159,6 +159,11 @@ registry_client_protocol = http # Default: False #db_auto_create = False +# Enable DEBUG log messages from sqlalchemy which prints every database +# query and response. +# Default: False +#sqlalchemy_debug = True + # ============ Notification System Options ===================== # Notifications can be sent when images are create, updated or deleted. diff --git a/etc/glance-registry.conf b/etc/glance-registry.conf index e67f7a442e..6a2f577559 100644 --- a/etc/glance-registry.conf +++ b/etc/glance-registry.conf @@ -55,6 +55,11 @@ limit_param_default = 25 # Default: False #db_auto_create = False +# Enable DEBUG log messages from sqlalchemy which prints every database +# query and response. +# Default: False +#sqlalchemy_debug = True + # ================= Syslog Options ============================ # Send logs to syslog (/dev/log) instead of to file specified diff --git a/glance/db/sqlalchemy/api.py b/glance/db/sqlalchemy/api.py index 216b7b1664..9e04b44423 100644 --- a/glance/db/sqlalchemy/api.py +++ b/glance/db/sqlalchemy/api.py @@ -70,6 +70,9 @@ db_opts = [ cfg.BoolOpt('db_auto_create', default=False, help=_('A boolean that determines if the database will be ' 'automatically created.')), + cfg.BoolOpt('sqlalchemy_debug', default=False, + help=_('Enable debug logging in sqlalchemy which prints ' + 'every query and result')) ] CONF = cfg.CONF @@ -118,7 +121,7 @@ def setup_db_env(): _RETRY_INTERVAL = CONF.sql_retry_interval _CONNECTION = CONF.sql_connection sa_logger = logging.getLogger('sqlalchemy.engine') - if CONF.debug: + if CONF.sqlalchemy_debug: sa_logger.setLevel(logging.DEBUG) @@ -188,7 +191,7 @@ def get_engine(): raise sa_logger = logging.getLogger('sqlalchemy.engine') - if CONF.debug: + if CONF.sqlalchemy_debug: sa_logger.setLevel(logging.DEBUG) if CONF.db_auto_create: