From 2c2b1cccc93771dfaa5a520c9d9634e5af47a55e Mon Sep 17 00:00:00 2001 From: Morgan Fainberg Date: Thu, 1 May 2014 22:05:41 -0700 Subject: [PATCH] Fix logging for keystone under mod_wsgi When Keystone is configured under mod_wsgi, Keystone configuration requires debugging to be enabled as the debug flag cannot be passed via cli arguments. Because Apache 2.2 (default for a number of distributions) does not support passing an explicit format to the ErrorLog, Keystone under mod_wsgi ends up with duplicated timestamps in the Keystone log. This patchset eliminates the %(asctime) and %(msecs) substitution targets from the log format options when Keystone is configured under mod_wsgi. Change-Id: I0bf32db6e53cb653921162cb1957eb988b819815 --- lib/keystone | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/keystone b/lib/keystone index b31cc57a56..5f9c57e3b7 100644 --- a/lib/keystone +++ b/lib/keystone @@ -253,11 +253,17 @@ function configure_keystone { fi # Format logging - if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then + if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ] && ! is_apache_enabled_service key ; then setup_colorized_logging $KEYSTONE_CONF DEFAULT fi if is_apache_enabled_service key; then + iniset $KEYSTONE_CONF DEFAULT debug "True" + # Eliminate the %(asctime)s.%(msecs)03d from the log format strings + iniset $KEYSTONE_CONF DEFAULT logging_context_format_string "%(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s" + iniset $KEYSTONE_CONF DEFAULT logging_default_format_string "%(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s" + iniset $KEYSTONE_CONF DEFAULT logging_debug_format_suffix "%(funcName)s %(pathname)s:%(lineno)d" + iniset $KEYSTONE_CONF DEFAULT logging_exception_prefix "%(process)d TRACE %(name)s %(instance)s" _config_keystone_apache_wsgi fi }