diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-03-29 18:26:46 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-03-29 18:26:46 +0000 |
| commit | 9cc356cbcf5f1cac9c7727f0fca5dad3db3187bd (patch) | |
| tree | 2ee8384063f7e5d51b38c574129c45b8601be0ae | |
| parent | 0941100bc7dc588d2dec55db7af7aebf4da2d753 (diff) | |
| parent | 6432997f672f5b20b3d5b6b961fc3b9bf1117022 (diff) | |
| download | nova-9cc356cbcf5f1cac9c7727f0fca5dad3db3187bd.tar.gz nova-9cc356cbcf5f1cac9c7727f0fca5dad3db3187bd.tar.xz nova-9cc356cbcf5f1cac9c7727f0fca5dad3db3187bd.zip | |
Merge "Support sql_connection_debug to get SQL diagnostic information"
| -rw-r--r-- | nova/db/sqlalchemy/session.py | 6 | ||||
| -rw-r--r-- | nova/flags.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/nova/db/sqlalchemy/session.py b/nova/db/sqlalchemy/session.py index fe1b44c41..eeadd9611 100644 --- a/nova/db/sqlalchemy/session.py +++ b/nova/db/sqlalchemy/session.py @@ -93,6 +93,12 @@ def get_engine(): 'convert_unicode': True, } + # Map our SQL debug level to SQLAlchemy's options + if FLAGS.sql_connection_debug >= 100: + engine_args['echo'] = 'debug' + elif FLAGS.sql_connection_debug >= 50: + engine_args['echo'] = True + if "sqlite" in connection_dict.drivername: engine_args["poolclass"] = NullPool diff --git a/nova/flags.py b/nova/flags.py index fb73182cf..430abe67e 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -99,6 +99,10 @@ core_opts = [ default='sqlite:///$state_path/$sqlite_db', help='The SQLAlchemy connection string used to connect to the ' 'database'), + cfg.IntOpt('sql_connection_debug', + default=0, + help='Verbosity of SQL debugging information. 0=None, ' + '100=Everything'), cfg.StrOpt('api_paste_config', default="api-paste.ini", help='File name for the paste.deploy config for nova-api'), |
