Browse code

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

Brant Knudson authored on 2014/01/23 10:06:44
Showing 1 changed files
... ...
@@ -247,14 +247,14 @@ function configure_keystone() {
247 247
     fi
248 248
 
249 249
     # Set up logging
250
-    LOGGING_ROOT="devel"
251 250
     if [ "$SYSLOG" != "False" ]; then
252
-        LOGGING_ROOT="$LOGGING_ROOT,production"
251
+        iniset $KEYSTONE_CONF DEFAULT use_syslog "True"
252
+    fi
253
+
254
+    # Format logging
255
+    if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
256
+        setup_colorized_logging $KEYSTONE_CONF DEFAULT
253 257
     fi
254
-    KEYSTONE_LOG_CONFIG="--log-config $KEYSTONE_CONF_DIR/logging.conf"
255
-    cp $KEYSTONE_DIR/etc/logging.conf.sample $KEYSTONE_CONF_DIR/logging.conf
256
-    iniset $KEYSTONE_CONF_DIR/logging.conf logger_root level "DEBUG"
257
-    iniset $KEYSTONE_CONF_DIR/logging.conf logger_root handlers "devel,production"
258 258
 
259 259
     if is_apache_enabled_service key; then
260 260
         _config_keystone_apache_wsgi
... ...
@@ -412,7 +412,7 @@ function start_keystone() {
412 412
         screen_it key "cd $KEYSTONE_DIR && sudo tail -f /var/log/$APACHE_NAME/keystone"
413 413
     else
414 414
         # Start Keystone in a screen window
415
-        screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF $KEYSTONE_LOG_CONFIG --debug"
415
+        screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF --debug"
416 416
     fi
417 417
 
418 418
     echo "Waiting for keystone to start..."