From 5743ed4679d43c325c5b3a2a4955088e35018c97 Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Thu, 8 Sep 2016 13:42:11 -0700 Subject: [PATCH] Reduce log level for ryu in OVS agent log In a tempest run, Ryu is logging about ~30K debug traces and it puts the OVS agent's log amongst the biggest log files in a single node OpenStack deployment in the gate. This patch sets Ryu and its components to log at INFO level and above to reduce the number of traces emitted. This patch, alongside [1,2], brings down the size of the biggest Neutron log files, server and OVS agent respectively. More can surely be done, however callbacks and ryu are the most obvious ones, and following up with further cuts may be dealt with on a ad-hoc basis. Closes-bug: #1620864 [1] https://review.openstack.org/#/c/366424/ [2] https://review.openstack.org/#/c/366478/ Change-Id: I40b7c77601788ae2e7428c7a0206ca2a807d10dc --- neutron/common/config.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/neutron/common/config.py b/neutron/common/config.py index da08dde7090..ffca4e61ebf 100644 --- a/neutron/common/config.py +++ b/neutron/common/config.py @@ -36,6 +36,15 @@ from neutron import version LOG = logging.getLogger(__name__) +# Jam here any extra log level default you care about. This helps keep +# Neutron logs lean. +EXTRA_LOG_LEVEL_DEFAULTS = [ + 'OFPHandler=INFO', + 'OfctlService=INFO', + 'ryu.base.app_manager=INFO', + 'ryu.controller.controller=INFO', +] + # Register the configuration options common_config.register_core_common_config_opts() @@ -86,10 +95,11 @@ def init(args, **kwargs): def setup_logging(): """Sets up the logging options for a log with supplied name.""" product_name = "neutron" - logging.setup(cfg.CONF, product_name) # We use the oslo.log default log levels and add only the extra levels # that Neutron needs. - logging.set_defaults(default_log_levels=logging.get_default_log_levels()) + logging.set_defaults(default_log_levels=logging.get_default_log_levels() + + EXTRA_LOG_LEVEL_DEFAULTS) + logging.setup(cfg.CONF, product_name) LOG.info(_LI("Logging enabled!")) LOG.info(_LI("%(prog)s version %(version)s"), {'prog': sys.argv[0],