From 1057bffa37cd2cbda088f747cd81122b42ff22a6 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Fri, 3 Aug 2012 11:42:51 +0000 Subject: [PATCH] Add log colouring to cinder. - based on vish's log coulouring version for nova. Change-Id: I9d4251b4292188c0174ebac1dcd98318df44c0e3 --- lib/cinder | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cinder b/lib/cinder index adcc52c6df..796c107160 100644 --- a/lib/cinder +++ b/lib/cinder @@ -114,6 +114,13 @@ function configure_cinder() { iniset $CINDER_CONF DEFAULT rabbit_password $RABBIT_PASSWORD fi + if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then + # Add color to logging output + 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" + iniset $CINDER_CONF DEFAULT logging_default_format_string "%(asctime)s %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s" + iniset $CINDER_CONF DEFAULT logging_debug_format_suffix "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d" + iniset $CINDER_CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s TRACE %(name)s %(instance)s" + fi } # init_cinder() - Initialize database and volume group