From f93acb15f36e77fa153e603f0e8693a75fc9381d Mon Sep 17 00:00:00 2001 From: "yolanda.robla@canonical.com" <> Date: Mon, 3 Feb 2014 14:05:03 +0100 Subject: [PATCH] added syslog functionality --- config.yaml | 6 ++++++ hooks/heat_context.py | 8 ++++++++ hooks/heat_utils.py | 3 ++- revision | 2 +- templates/heat.conf | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index 824a12a..de5c98c 100644 --- a/config.yaml +++ b/config.yaml @@ -46,3 +46,9 @@ options: default: "" type: string description: Encryption key used for authentication info in database + use-syslog: + type: boolean + default: False + description: | + By default, all services will log into their corresponding log files. + Setting this to True will force all services to log to the syslog. diff --git a/hooks/heat_context.py b/hooks/heat_context.py index 4842097..d889466 100644 --- a/hooks/heat_context.py +++ b/hooks/heat_context.py @@ -53,3 +53,11 @@ class EncryptionContext(context.OSContextGenerator): encryption = get_encryption_key() ctxt['encryption_key'] = encryption return ctxt + + +class HeatContext(context.OSContextGenerator): + def __call__(self): + ctxt = { + 'use_syslog': config('use-syslog') + } + return ctxt diff --git a/hooks/heat_utils.py b/hooks/heat_utils.py index c7cdbf5..6d563ad 100644 --- a/hooks/heat_utils.py +++ b/hooks/heat_utils.py @@ -54,7 +54,8 @@ CONFIG_FILES = OrderedDict([ context.SharedDBContext(relation_prefix='heat'), context.OSConfigFlagContext(), heat_context.HeatIdentityServiceContext(), - heat_context.EncryptionContext()] + heat_context.EncryptionContext(), + heat_context.HeatContext()] }), (HEAT_API_PASTE, { 'services': [s for s in BASE_SERVICES if 'api' in s], diff --git a/revision b/revision index b4de394..48082f7 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -11 +12 diff --git a/templates/heat.conf b/templates/heat.conf index c2c3626..a64af65 100644 --- a/templates/heat.conf +++ b/templates/heat.conf @@ -42,6 +42,7 @@ sql_connection = mysql://{{ database_user }}:{{ database_password }}@{{ database verbose = True log_dir = /var/log/heat +use_syslog = {{ use_syslog }} [keystone_authtoken] auth_host = {{ service_host }}