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
This commit is contained in:
Armando Migliaccio 2016-09-08 13:42:11 -07:00 committed by Ihar Hrachyshka
parent a7c8a825a4
commit 5743ed4679
1 changed files with 12 additions and 2 deletions

View File

@ -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],