Browse code

Merge "Colorize heat engine log"

Jenkins authored on 2013/08/16 22:38:43
Showing 1 changed files
... ...
@@ -125,6 +125,14 @@ function configure_heat() {
125 125
 
126 126
     iniset_rpc_backend heat $HEAT_ENGINE_CONF DEFAULT
127 127
 
128
+    if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
129
+        # Add color to logging output
130
+        iniset $HEAT_ENGINE_CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s%(color)s] %(instance)s%(color)s%(message)s"
131
+        iniset $HEAT_ENGINE_CONF DEFAULT logging_default_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s"
132
+        iniset $HEAT_ENGINE_CONF DEFAULT logging_debug_format_suffix "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d"
133
+        iniset $HEAT_ENGINE_CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s %(instance)s"
134
+    fi
135
+
128 136
     # Cloudwatch API
129 137
     HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf
130 138
     cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF