summaryrefslogtreecommitdiff
path: root/zuul
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2017-08-29 15:22:21 -0500
committerMonty Taylor <mordred@inaugust.com>2017-08-29 15:22:21 -0500
commit581a1b7dfd1710cfad26258e5ab3e396082a5430 (patch)
tree860f53f119e9031f8630153b38e0c359e8149b35 /zuul
parentd414f2fd1055a23706fae75d0dc8e10d92b45297 (diff)
downloadzuul-581a1b7dfd1710cfad26258e5ab3e396082a5430.tar.gz
Raise default logging level to debug if nodaemon is passed
Change-Id: I5a40e3f6d73b4a58df0d6419a360b23e54df3dd4
Diffstat (limited to 'zuul')
-rw-r--r--zuul/ansible/logconfig.py7
-rwxr-xr-xzuul/cmd/__init__.py1
2 files changed, 8 insertions, 0 deletions
diff --git a/zuul/ansible/logconfig.py b/zuul/ansible/logconfig.py
index 138ad8be9..22d74ca80 100644
--- a/zuul/ansible/logconfig.py
+++ b/zuul/ansible/logconfig.py
@@ -219,6 +219,13 @@ class ServerLoggingConfig(DictLoggingConfig):
if logger['handlers'] == ['console']:
logger['handlers'] = ['normal']
+ def setDebug(self):
+ # Change level from INFO to DEBUG
+ for section in ('handlers', 'loggers'):
+ for handler in self._config[section].values():
+ if handler.get('level') == 'INFO':
+ handler['level'] = 'DEBUG'
+
class FileLoggingConfig(LoggingConfig):
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py
index 3de9ef5db..a5db9a6ee 100755
--- a/zuul/cmd/__init__.py
+++ b/zuul/cmd/__init__.py
@@ -90,6 +90,7 @@ class ZuulApp(object):
# config, leave the config set to emit to stdout.
if hasattr(self.args, 'nodaemon') and self.args.nodaemon:
logging_config = logconfig.ServerLoggingConfig()
+ logging_config.setDebug()
else:
# Setting a server value updates the defaults to use
# WatchedFileHandler on /var/log/zuul/{server}-debug.log