From 4968d1ad5d8d6b0537c68548eb5f8c08bc33f63a Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Wed, 22 Jan 2014 19:06:44 -0600 Subject: [PATCH] Keystone use common logging setup The Keystone setup was using logging.conf to configure logging, unlike other projects. This may have been left over from before Keystone switched to oslo logging. Switching to common logging configuration allows: - Common format for logs for easier parsing - Pretty colorized logs - Keystone can control the default logging levels for libraries that are used by setting the defaults in keystone. - Potentially using a function to setup logging for all components using oslo-logging (e.g., share with lib/nova). Change-Id: I4e9b1e6cffce30f16a1e039224312852b8abda07 Closes-Bug: #1271775 Closes-Bug: #1269987 --- lib/keystone | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/keystone b/lib/keystone index ceefe6a144..7f0bcf24a7 100644 --- a/lib/keystone +++ b/lib/keystone @@ -247,14 +247,14 @@ function configure_keystone() { fi # Set up logging - LOGGING_ROOT="devel" if [ "$SYSLOG" != "False" ]; then - LOGGING_ROOT="$LOGGING_ROOT,production" + iniset $KEYSTONE_CONF DEFAULT use_syslog "True" + fi + + # Format logging + if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then + setup_colorized_logging $KEYSTONE_CONF DEFAULT fi - KEYSTONE_LOG_CONFIG="--log-config $KEYSTONE_CONF_DIR/logging.conf" - cp $KEYSTONE_DIR/etc/logging.conf.sample $KEYSTONE_CONF_DIR/logging.conf - iniset $KEYSTONE_CONF_DIR/logging.conf logger_root level "DEBUG" - iniset $KEYSTONE_CONF_DIR/logging.conf logger_root handlers "devel,production" if is_apache_enabled_service key; then _config_keystone_apache_wsgi @@ -412,7 +412,7 @@ function start_keystone() { screen_it key "cd $KEYSTONE_DIR && sudo tail -f /var/log/$APACHE_NAME/keystone" else # Start Keystone in a screen window - screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF $KEYSTONE_LOG_CONFIG --debug" + screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF --debug" fi echo "Waiting for keystone to start..."