Browse code

Add log colouring to cinder.

- based on vish's log coulouring version for nova.

Change-Id: I9d4251b4292188c0174ebac1dcd98318df44c0e3

Chmouel Boudjnah authored on 2012/08/03 20:42:51
Showing 1 changed files
... ...
@@ -114,6 +114,13 @@ function configure_cinder() {
114 114
         iniset $CINDER_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
115 115
     fi
116 116
 
117
+    if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
118
+        # Add color to logging output
119
+        iniset $CINDER_CONF DEFAULT logging_context_format_string "%(asctime)s %(color)s%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s%(color)s] %(instance)s%(color)s%(message)s"
120
+        iniset $CINDER_CONF DEFAULT logging_default_format_string "%(asctime)s %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s"
121
+        iniset $CINDER_CONF DEFAULT logging_debug_format_suffix "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d"
122
+        iniset $CINDER_CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s TRACE %(name)s %(instance)s"
123
+    fi
117 124
 }
118 125
 
119 126
 # init_cinder() - Initialize database and volume group