Improve debug logging

* Update default log levels
* Make iptables logging more compact by removing newlines
* Enable debug logging in devstack plugin by default

Change-Id: I2af558078cb27edb5f162372d52c048f0e659079
This commit is contained in:
Dmitry Tantsur 2015-12-09 10:16:51 +01:00
parent c45ba39ec3
commit 0533f463fd
4 changed files with 19 additions and 10 deletions

View File

@ -1,4 +1,4 @@
IRONIC_INSPECTOR_DEBUG=${IRONIC_INSPECTOR_DEBUG:-false}
IRONIC_INSPECTOR_DEBUG=${IRONIC_INSPECTOR_DEBUG:-True}
IRONIC_INSPECTOR_DIR=$DEST/ironic-inspector
IRONIC_INSPECTOR_BIN_DIR=$(get_python_exec_prefix)
IRONIC_INSPECTOR_BIN_FILE=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector

View File

@ -41,11 +41,12 @@ def _iptables(*args, **kwargs):
try:
subprocess.check_output(cmd, **kwargs)
except subprocess.CalledProcessError as exc:
output = exc.output.replace('\n', '. ')
if ignore:
LOG.debug('ignoring failed iptables %s:\n%s', args, exc.output)
LOG.debug('Ignoring failed iptables %s: %s', args, output)
else:
LOG.error(_LE('iptables %(iptables)s failed:\n%(exc)s') %
{'iptables': args, 'exc': exc.output})
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') %
{'iptables': args, 'exc': output})
raise

View File

@ -367,14 +367,18 @@ def create_ssl_context():
def main(args=sys.argv[1:]): # pragma: no cover
log.register_options(CONF)
CONF(args, project='ironic-inspector')
debug = CONF.debug
log.set_defaults(default_log_levels=[
'urllib3.connectionpool=WARN',
'keystonemiddleware.auth_token=WARN',
'requests.packages.urllib3.connectionpool=WARN',
('ironicclient.common.http=INFO' if debug else
'ironicclient.common.http=ERROR')])
'sqlalchemy=WARNING',
'keystoneclient=INFO',
'iso8601=WARNING',
'requests=WARNING',
'urllib3.connectionpool=WARNING',
'keystonemiddleware=WARNING',
'swiftclient=WARNING',
'keystoneauth=WARNING',
'ironicclient=WARNING'
])
log.setup(CONF, 'ironic_inspector')
app_kwargs = {'host': CONF.listen_address,

View File

@ -0,0 +1,4 @@
---
other:
- Make debug-level logging more compact by removing newlines from firewall
logging and disabling some 3rdparty debug messages by default.