From 0413d2db8d55f0d6a32551bc48a8e7d65800a0e2 Mon Sep 17 00:00:00 2001 From: Flavio Fernandes Date: Fri, 9 Jan 2015 16:09:12 -0500 Subject: [PATCH] Add param for turning on debug logs on opendaylight's net-virt When looking at issues related to opendaylight and openstack, it helps to bump up the logs on ovsdb and neutron northbound. This commit introduces a param for doing that: ODL_NETVIRT_DEBUG_LOGS=True Change-Id: I109fc61ddc44255de031341fb41bef8db5f0714f --- lib/opendaylight | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/opendaylight b/lib/opendaylight index 2f0f37e34d..6518673524 100644 --- a/lib/opendaylight +++ b/lib/opendaylight @@ -72,6 +72,11 @@ ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS:-physnet1:eth1} # Enable OpenDaylight l3 forwarding ODL_L3=${ODL_L3:-False} +# Enable debug logs for odl ovsdb +ODL_NETVIRT_DEBUG_LOGS=${ODL_NETVIRT_DEBUG_LOGS:-False} + +# The logging config file in ODL +ODL_LOGGING_CONFIG=${ODL_LOGGING_CONFIG:-${ODL_DIR}/${ODL_NAME}/etc/org.ops4j.pax.logging.cfg} # Entry Points # ------------ @@ -111,6 +116,22 @@ function configure_opendaylight { echo "ovsdb.l3.fwd.enabled=yes" >> $ODL_DIR/$ODL_NAME/etc/custom.properties fi fi + + # Configure DEBUG logs for network virtualization in odl, if the user wants it + if [ "${ODL_NETVIRT_DEBUG_LOGS}" == "True" ]; then + local OVSDB_DEBUG_LOGS=$(cat $ODL_LOGGING_CONFIG | grep ^log4j.logger.org.opendaylight.ovsdb) + if [ "${OVSDB_DEBUG_LOGS}" == "" ]; then + echo 'log4j.logger.org.opendaylight.ovsdb = TRACE' >> $ODL_LOGGING_CONFIG + echo 'log4j.logger.org.opendaylight.ovsdb.lib = INFO' >> $ODL_LOGGING_CONFIG + echo 'log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter = DEBUG' >> $ODL_LOGGING_CONFIG + echo 'log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.impl.TenantNetworkManagerImpl = DEBUG' >> $ODL_LOGGING_CONFIG + echo 'log4j.logger.org.opendaylight.ovsdb.plugin.md.OvsdbInventoryManager = INFO' >> $ODL_LOGGING_CONFIG + fi + local ODL_NEUTRON_DEBUG_LOGS=$(cat $ODL_LOGGING_CONFIG | grep ^log4j.logger.org.opendaylight.controller.networkconfig.neutron) + if [ "${ODL_NEUTRON_DEBUG_LOGS}" == "" ]; then + echo 'log4j.logger.org.opendaylight.controller.networkconfig.neutron = TRACE' >> $ODL_LOGGING_CONFIG + fi + fi } function configure_ml2_odl {