File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,9 @@ SYSLOG=`trueorfalse False $SYSLOG`
262262SYSLOG_HOST=${SYSLOG_HOST:- $HOST_IP }
263263SYSLOG_PORT=${SYSLOG_PORT:- 516}
264264
265+ # Use color for logging output
266+ LOG_COLOR=` trueorfalse True $LOG_COLOR `
267+
265268# Service startup timeout
266269SERVICE_TIMEOUT=${SERVICE_TIMEOUT:- 60}
267270
@@ -1709,6 +1712,16 @@ fi
17091712if [ " $API_RATE_LIMIT " != " True" ]; then
17101713 add_nova_opt " api_rate_limit=False"
17111714fi
1715+ if [ " $LOG_COLOR " == " True" ] && [ " $SYSLOG " == " False" ]; then
1716+ # Add color to logging output
1717+ add_nova_opt " logging_context_format_string=%(asctime)s %(color)s%(levelname)s %(name)s [[01;36m%(request_id)s [00;36m%(user_name)s %(project_name)s%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m"
1718+ add_nova_opt " logging_default_format_string=%(asctime)s %(color)s%(levelname)s %(name)s [[00;36m-%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m"
1719+ add_nova_opt " logging_debug_format_suffix=[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d[00m"
1720+ add_nova_opt " logging_exception_prefix=%(color)s%(asctime)s TRACE %(name)s [01;35m%(instance)s[00m"
1721+ else
1722+ # Show user_name and project_name instead of user_id and project_id
1723+ add_nova_opt " logging_context_format_string=%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s"
1724+ fi
17121725
17131726
17141727# Provide some transition from EXTRA_FLAGS to EXTRA_OPTS
You can’t perform that action at this time.
0 commit comments