Allow loading logging config from yaml

The newer dictConfig logging configuration allows a much more flexible
configuration and should be used in preference to the file config. For
backwards compatibility if the logging configuration has a yaml
extension then load it, otherwise fall back to the file config.

Change-Id: I755c785ad22c2d3b3e1e13784f2b2c8640211639
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py
index 3102f3b..9fa4c03 100644
--- a/zuul/cmd/__init__.py
+++ b/zuul/cmd/__init__.py
@@ -24,6 +24,7 @@
 import sys
 import traceback
 
+import yaml
 yappi = extras.try_import('yappi')
 
 import zuul.lib.connections
@@ -86,7 +87,14 @@
             if not os.path.exists(fp):
                 raise Exception("Unable to read logging config file at %s" %
                                 fp)
-            logging.config.fileConfig(fp)
+
+            if os.path.splitext(fp)[1] in ('.yml', '.yaml'):
+                with open(fp, 'r') as f:
+                    logging.config.dictConfig(yaml.safe_load(f))
+
+            else:
+                logging.config.fileConfig(fp)
+
         else:
             logging.basicConfig(level=logging.DEBUG)