Browse code

Add logging config to cinder.conf

Part of the effort to clean up the Cinder logs is to use
the resource tag in the log format. We also want to have
some consistency with other projects in how we do logging.

This change adds the logging format to cinder.conf similar to
what Nova and others use, and most importantly turns on the use
of the resource tag that's in olso_log.

We're slowly cleaning up the logging in Cinder by doing things
like replacing "Delete volume %(volume_id)s compoleted" with
("Delete volume completed successfully.", resource=volume)

It woudl be good to have these picked up as we transition so we're
not missing info. Also, there's sure to be cases where "volume"
isn't a valid dbref and we find issues that need fixed.

Change-Id: I193637fea14d97183f6a9782f37d8edcf929e0c4

John Griffith authored on 2015/04/19 02:20:15
Showing 1 changed files
... ...
@@ -264,6 +264,9 @@ function configure_cinder {
264 264
     # Format logging
265 265
     if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
266 266
         setup_colorized_logging $CINDER_CONF DEFAULT "project_id" "user_id"
267
+    else
268
+        # Set req-id, project-name and resource in log format
269
+        iniset $CINDER_CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(levelname)s %(name)s [%(request_id)s %(project_name)s] %(resource)s%(message)s"
267 270
     fi
268 271
 
269 272
     if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then