Browse code

Merge "Adding optional colorized log output for trove"

Jenkins authored on 2013/12/07 04:28:17
Showing 1 changed files
... ...
@@ -32,6 +32,17 @@ TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove
32 32
 TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
33 33
 TROVE_BIN_DIR=/usr/local/bin
34 34
 
35
+# setup_trove_logging() - Adds logging configuration to conf files
36
+function setup_trove_logging() {
37
+    local CONF=$1
38
+    iniset $CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
39
+    iniset $CONF DEFAULT use_syslog $SYSLOG
40
+    if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
41
+        # Add color to logging output
42
+        setup_colorized_logging $CONF DEFAULT tenant user
43
+    fi
44
+}
45
+
35 46
 # create_trove_accounts() - Set up common required trove accounts
36 47
 
37 48
 # Tenant               User       Roles
... ...
@@ -121,6 +132,9 @@ function configure_trove() {
121 121
     iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT control_exchange trove
122 122
     sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
123 123
 
124
+    setup_trove_logging $TROVE_CONF_DIR/trove.conf
125
+    setup_trove_logging $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
126
+
124 127
     # (Re)create trove taskmanager conf file if needed
125 128
     if is_service_enabled tr-tmgr; then
126 129
         TROVE_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT//v$IDENTITY_API_VERSION
... ...
@@ -132,6 +146,7 @@ function configure_trove() {
132 132
         iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT nova_proxy_admin_tenant_name trove
133 133
         iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT nova_proxy_admin_pass $RADMIN_USER_PASS
134 134
         iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT trove_auth_url $TROVE_AUTH_ENDPOINT
135
+        setup_trove_logging $TROVE_CONF_DIR/trove-taskmanager.conf
135 136
     fi
136 137
 
137 138
     # (Re)create trove conductor conf file if needed
... ...
@@ -143,6 +158,7 @@ function configure_trove() {
143 143
         iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT nova_proxy_admin_pass $RADMIN_USER_PASS
144 144
         iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT trove_auth_url $TROVE_AUTH_ENDPOINT
145 145
         iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT control_exchange trove
146
+        setup_trove_logging $TROVE_CONF_DIR/trove-conductor.conf
146 147
     fi
147 148
 }
148 149