From 039979424bebc71b94f53f51030eda5e9d2b7734 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Sat, 10 Aug 2013 09:56:16 -0500 Subject: [PATCH] Allow disabling of debug logging I find that enabling the debug log level often causes me to miss important error messages due to the sheer volume of information logged. This change allows configuration of the debug option in a number of the projects so it can be disabled globally without having to make one-off changes after each re-stack. Note that this does not apply to Keystone or Swift right now. They use a different method to configure their logging level and I'm not as familiar with them so I didn't want to mess with their settings. Change-Id: I185d496543d245a644854c8a37f3359377cb978c --- lib/cinder | 2 +- lib/glance | 6 +++--- lib/heat | 8 ++++---- lib/neutron | 10 +++++----- lib/nova | 2 +- stack.sh | 3 +++ 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/cinder b/lib/cinder index 14950c7f4d..f49eda15be 100644 --- a/lib/cinder +++ b/lib/cinder @@ -212,7 +212,7 @@ function configure_cinder() { cp $CINDER_DIR/etc/cinder/cinder.conf.sample $CINDER_CONF iniset $CINDER_CONF DEFAULT auth_strategy keystone - iniset $CINDER_CONF DEFAULT debug True + iniset $CINDER_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $CINDER_CONF DEFAULT verbose True if [ "$CINDER_MULTI_LVM_BACKEND" = "True" ]; then iniset $CINDER_CONF DEFAULT enabled_backends lvmdriver-1,lvmdriver-2 diff --git a/lib/glance b/lib/glance index 583f879555..a18189f474 100644 --- a/lib/glance +++ b/lib/glance @@ -71,7 +71,7 @@ function configure_glance() { # Copy over our glance configurations and update them cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF - iniset $GLANCE_REGISTRY_CONF DEFAULT debug True + iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file local dburl=`database_connection_url glance` iniset $GLANCE_REGISTRY_CONF DEFAULT sql_connection $dburl @@ -87,7 +87,7 @@ function configure_glance() { iniset $GLANCE_REGISTRY_CONF keystone_authtoken signing_dir $GLANCE_AUTH_CACHE_DIR/registry cp $GLANCE_DIR/etc/glance-api.conf $GLANCE_API_CONF - iniset $GLANCE_API_CONF DEFAULT debug True + iniset $GLANCE_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $GLANCE_API_CONF DEFAULT log_file iniset $GLANCE_API_CONF DEFAULT sql_connection $dburl iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG @@ -123,7 +123,7 @@ function configure_glance() { cp -p $GLANCE_DIR/etc/glance-api-paste.ini $GLANCE_API_PASTE_INI cp $GLANCE_DIR/etc/glance-cache.conf $GLANCE_CACHE_CONF - iniset $GLANCE_CACHE_CONF DEFAULT debug True + iniset $GLANCE_CACHE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $GLANCE_CACHE_CONF DEFAULT log_file iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG iniset $GLANCE_CACHE_CONF DEFAULT filesystem_store_datadir $GLANCE_IMAGE_DIR/ diff --git a/lib/heat b/lib/heat index 1b715f2b55..3c3b2c4a2d 100644 --- a/lib/heat +++ b/lib/heat @@ -68,7 +68,7 @@ function configure_heat() { # Cloudformation API HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf cp $HEAT_DIR/etc/heat/heat-api-cfn.conf $HEAT_API_CFN_CONF - iniset $HEAT_API_CFN_CONF DEFAULT debug True + iniset $HEAT_API_CFN_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $HEAT_API_CFN_CONF DEFAULT log_file iniset $HEAT_API_CFN_CONF DEFAULT use_syslog $SYSLOG iniset $HEAT_API_CFN_CONF DEFAULT bind_host $HEAT_API_CFN_HOST @@ -90,7 +90,7 @@ function configure_heat() { # OpenStack API HEAT_API_CONF=$HEAT_CONF_DIR/heat-api.conf cp $HEAT_DIR/etc/heat/heat-api.conf $HEAT_API_CONF - iniset $HEAT_API_CONF DEFAULT debug True + iniset $HEAT_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $HEAT_API_CONF DEFAULT log_file iniset $HEAT_API_CONF DEFAULT use_syslog $SYSLOG iniset $HEAT_API_CONF DEFAULT bind_host $HEAT_API_HOST @@ -112,7 +112,7 @@ function configure_heat() { # engine HEAT_ENGINE_CONF=$HEAT_CONF_DIR/heat-engine.conf cp $HEAT_DIR/etc/heat/heat-engine.conf $HEAT_ENGINE_CONF - iniset $HEAT_ENGINE_CONF DEFAULT debug True + iniset $HEAT_ENGINE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $HEAT_ENGINE_CONF DEFAULT log_file iniset $HEAT_ENGINE_CONF DEFAULT use_syslog $SYSLOG iniset $HEAT_ENGINE_CONF DEFAULT bind_host $HEAT_ENGINE_HOST @@ -128,7 +128,7 @@ function configure_heat() { # Cloudwatch API HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF - iniset $HEAT_API_CW_CONF DEFAULT debug True + iniset $HEAT_API_CW_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL inicomment $HEAT_API_CW_CONF DEFAULT log_file iniset $HEAT_API_CW_CONF DEFAULT use_syslog $SYSLOG iniset $HEAT_API_CW_CONF DEFAULT bind_host $HEAT_API_CW_HOST diff --git a/lib/neutron b/lib/neutron index 306140a4b5..564315b107 100644 --- a/lib/neutron +++ b/lib/neutron @@ -537,7 +537,7 @@ function _configure_neutron_dhcp_agent() { cp $NEUTRON_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE iniset $Q_DHCP_CONF_FILE DEFAULT verbose True - iniset $Q_DHCP_CONF_FILE DEFAULT debug True + iniset $Q_DHCP_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" @@ -557,7 +557,7 @@ function _configure_neutron_l3_agent() { cp $NEUTRON_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE iniset $Q_L3_CONF_FILE DEFAULT verbose True - iniset $Q_L3_CONF_FILE DEFAULT debug True + iniset $Q_L3_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" @@ -573,7 +573,7 @@ function _configure_neutron_metadata_agent() { cp $NEUTRON_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE iniset $Q_META_CONF_FILE DEFAULT verbose True - iniset $Q_META_CONF_FILE DEFAULT debug True + iniset $Q_META_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP iniset $Q_META_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" @@ -597,7 +597,7 @@ function _configure_neutron_plugin_agent() { # ensure that an agent's configuration can override the default iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND" iniset $NEUTRON_CONF DEFAULT verbose True - iniset $NEUTRON_CONF DEFAULT debug True + iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL # Configure agent for plugin neutron_plugin_configure_plugin_agent @@ -620,7 +620,7 @@ function _configure_neutron_service() { fi iniset $NEUTRON_CONF DEFAULT verbose True - iniset $NEUTRON_CONF DEFAULT debug True + iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL iniset $NEUTRON_CONF DEFAULT policy_file $Q_POLICY_FILE iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP diff --git a/lib/nova b/lib/nova index 9c38498d8c..842c098624 100644 --- a/lib/nova +++ b/lib/nova @@ -430,7 +430,7 @@ function create_nova_conf() { # (Re)create ``nova.conf`` rm -f $NOVA_CONF iniset $NOVA_CONF DEFAULT verbose "True" - iniset $NOVA_CONF DEFAULT debug "True" + iniset $NOVA_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" iniset $NOVA_CONF DEFAULT auth_strategy "keystone" iniset $NOVA_CONF DEFAULT allow_resize_to_same_host "True" iniset $NOVA_CONF DEFAULT api_paste_config "$NOVA_API_PASTE_INI" diff --git a/stack.sh b/stack.sh index aca49d0ae9..e2703224a4 100755 --- a/stack.sh +++ b/stack.sh @@ -250,6 +250,9 @@ OFFLINE=`trueorfalse False $OFFLINE` # operation. ERROR_ON_CLONE=`trueorfalse False $ERROR_ON_CLONE` +# Whether to enable the debug log level in OpenStack services +ENABLE_DEBUG_LOG_LEVEL=`trueorfalse True $ENABLE_DEBUG_LOG_LEVEL` + # Destination path for service data DATA_DIR=${DATA_DIR:-${DEST}/data} sudo mkdir -p $DATA_DIR