Merge "Make the log output pretty and more useful"

This commit is contained in:
Jenkins 2012-06-14 18:41:39 +00:00 committed by Gerrit Code Review
commit 0c48554a52

View File

@ -262,6 +262,9 @@ SYSLOG=`trueorfalse False $SYSLOG`
SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP} SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP}
SYSLOG_PORT=${SYSLOG_PORT:-516} SYSLOG_PORT=${SYSLOG_PORT:-516}
# Use color for logging output
LOG_COLOR=`trueorfalse True $LOG_COLOR`
# Service startup timeout # Service startup timeout
SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60} SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}
@ -1762,6 +1765,16 @@ fi
if [ "$API_RATE_LIMIT" != "True" ]; then if [ "$API_RATE_LIMIT" != "True" ]; then
add_nova_opt "api_rate_limit=False" add_nova_opt "api_rate_limit=False"
fi fi
if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
# Add color to logging output
add_nova_opt "logging_context_format_string=%(asctime)s %(color)s%(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s%(color)s] %(instance)s%(color)s%(message)s"
add_nova_opt "logging_default_format_string=%(asctime)s %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s"
add_nova_opt "logging_debug_format_suffix=from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d"
add_nova_opt "logging_exception_prefix=%(color)s%(asctime)s TRACE %(name)s %(instance)s"
else
# Show user_name and project_name instead of user_id and project_id
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"
fi
# Provide some transition from EXTRA_FLAGS to EXTRA_OPTS # Provide some transition from EXTRA_FLAGS to EXTRA_OPTS