From feeed16f910645d218c202a10ce13944fb44bc7f Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 28 Jul 2014 20:40:36 -0700 Subject: [PATCH] Have task/flow logging go to a separate log file To be able to point the taskflow logging at a task log we need to be able to separate the logs coming from cinder from the logs coming from taskflow (as well as the listener that acts as the intermediary between both projects). To start the process of having a detailed task log location, add-in a new log setting that can be used for just this purpose. This is not the most ideal way of doing this, since it just provides a sample logging configuration adjustment, but there does not appear to be a better way (due to how cinder/openstack/common/logging.py can't be modified or adjusted with a better option). Part of blueprint task-logging Change-Id: I5e3946c71110ee1b923c2258f3a7eb83c358426b --- etc/cinder/logging_sample.conf | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/etc/cinder/logging_sample.conf b/etc/cinder/logging_sample.conf index 50f713f7d..03f620190 100644 --- a/etc/cinder/logging_sample.conf +++ b/etc/cinder/logging_sample.conf @@ -1,8 +1,8 @@ [loggers] -keys = root, cinder +keys = root, cinder, taskflow, cinder_flow_utils [handlers] -keys = stderr, stdout, watchedfile, syslog, null +keys = stderr, stdout, watchedfile, syslog, tasks, null [formatters] keys = context, default @@ -16,6 +16,18 @@ level = INFO handlers = stderr qualname = cinder +# Both of these are used for tracking what cinder and taskflow is doing with +# regard to flows and tasks (and the activity there-in). +[logger_cinder_flow_utils] +level = INFO +handlers = tasks,stderr +qualname = cinder.flow_utils + +[logger_taskflow] +level = INFO +handlers = tasks +qualname = taskflow + [logger_amqplib] level = WARNING handlers = stderr @@ -59,6 +71,11 @@ class = handlers.WatchedFileHandler args = ('cinder.log',) formatter = context +[handler_tasks] +class = handlers.WatchedFileHandler +args = ('tasks.log',) +formatter = context + [handler_syslog] class = handlers.SysLogHandler args = ('/dev/log', handlers.SysLogHandler.LOG_USER) -- 2.45.2