From aa5552e0d4b1a1b30594582a6efdf73e64aa4f82 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Sat, 12 Aug 2017 11:46:20 -0700 Subject: [PATCH] Fix octavia logging to be more friendly Configures the octavia devstack plugin to use devstack's setup_logging function to standardize the octavia gate log format. Octavia processes will now print the version string to the logs on startup. Change-Id: I094636a983fb0bcac2a1a1445b3487eac88a5e75 Closes-Bug: #1694588 --- devstack/plugin.sh | 3 +++ octavia/common/config.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index a8cdc4c039..28f4458d48 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -188,6 +188,9 @@ function octavia_configure { cp $OCTAVIA_DIR/etc/octavia.conf $OCTAVIA_CONF fi + # Use devstack logging configuration + setup_logging $OCTAVIA_CONF + # Change bind host iniset $OCTAVIA_CONF DEFAULT bind_host $SERVICE_HOST diff --git a/octavia/common/config.py b/octavia/common/config.py index 7a0918f452..14fd5fa59c 100644 --- a/octavia/common/config.py +++ b/octavia/common/config.py @@ -17,6 +17,8 @@ Routines for configuring Octavia """ +import sys + from keystoneauth1 import loading as ks_loading from oslo_config import cfg from oslo_db import options as db_options @@ -577,6 +579,10 @@ def setup_logging(conf): product_name = "octavia" logging.setup(conf, product_name) LOG.info("Logging enabled!") + LOG.info("%(prog)s version %(version)s", + {'prog': sys.argv[0], + 'version': version.version_info.release_string()}) + LOG.debug("command line: %s", " ".join(sys.argv)) # Use cfg.CONF.set_default to override the new configuration setting