diff --git a/devstack/plugin.sh b/devstack/plugin.sh index fff593dde..ff6b00336 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -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 diff --git a/ironic_inspector/firewall.py b/ironic_inspector/firewall.py index d2cfb9135..2f160a9fd 100644 --- a/ironic_inspector/firewall.py +++ b/ironic_inspector/firewall.py @@ -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 diff --git a/ironic_inspector/main.py b/ironic_inspector/main.py index 6351e7613..05fd9a886 100644 --- a/ironic_inspector/main.py +++ b/ironic_inspector/main.py @@ -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, diff --git a/releasenotes/notes/compact-debug-logging-b15dd9bbdd3ce27a.yaml b/releasenotes/notes/compact-debug-logging-b15dd9bbdd3ce27a.yaml new file mode 100644 index 000000000..583306a53 --- /dev/null +++ b/releasenotes/notes/compact-debug-logging-b15dd9bbdd3ce27a.yaml @@ -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.