Merge "Turn off debug logging in sqlalchemy by default"

This commit is contained in:
Jenkins 2013-08-02 19:21:57 +00:00 committed by Gerrit Code Review
commit 2f05e71f56
3 changed files with 15 additions and 2 deletions

View File

@ -166,6 +166,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.

View File

@ -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

View File

@ -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: