From 214da889683489ef454807a861a9e2e2b333d06b Mon Sep 17 00:00:00 2001 From: Andrew Melton Date: Sun, 10 Nov 2013 20:16:26 -0500 Subject: [PATCH] Creating parent logger for usage audit --- reports/nova_usage_audit.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reports/nova_usage_audit.py b/reports/nova_usage_audit.py index b7b94a1..5afebbd 100644 --- a/reports/nova_usage_audit.py +++ b/reports/nova_usage_audit.py @@ -31,6 +31,7 @@ import usage_audit from stacktach import datetime_to_decimal as dt from stacktach import models from stacktach.reconciler import Reconciler +from stacktach import stacklog OLD_LAUNCHES_QUERY = """ select stacktach_instanceusage.id, @@ -268,6 +269,11 @@ if __name__ == '__main__': default='/etc/stacktach/reconciler-config.json') args = parser.parse_args() + stacklog.set_default_logger_name('nova_usage_audit') + parent_logger = stacklog.get_logger('nova_usage_audit', is_parent=True) + log_listener = stacklog.LogListener(parent_logger) + log_listener.start() + if args.reconcile: with open(args.reconciler_config) as f: reconciler_config = json.load(f)