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
This commit is contained in:
Joshua Harlow 2014-07-28 20:40:36 -07:00
parent d5b7735137
commit feeed16f91

@ -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)