diff --git a/src/pylorax/api/yumbase.py b/src/pylorax/api/yumbase.py index 18377e68..996bfeca 100644 --- a/src/pylorax/api/yumbase.py +++ b/src/pylorax/api/yumbase.py @@ -22,6 +22,8 @@ from fnmatch import fnmatchcase from glob import glob import os import yum +# This is a hack to short circuit yum's internal logging +yum.logginglevels._added_handlers = True from pylorax.sysutils import joinpaths diff --git a/src/sbin/lorax-composer b/src/sbin/lorax-composer index 2c3df668..d9c45015 100755 --- a/src/sbin/lorax-composer +++ b/src/sbin/lorax-composer @@ -22,6 +22,7 @@ log = logging.getLogger("lorax-composer") program_log = logging.getLogger("program") pylorax_log = logging.getLogger("pylorax") server_log = logging.getLogger("server") +yum_log = logging.getLogger("yum") import argparse import os @@ -96,6 +97,13 @@ def setup_logging(logfile): fh.setLevel(logging.DEBUG) server_log.addHandler(fh) + # YUM logging + yum_log.setLevel(logging.DEBUG) + logfile = os.path.abspath(os.path.dirname(logfile))+"/yum.log" + fh = logging.FileHandler(filename=logfile) + fh.setLevel(logging.DEBUG) + yum_log.addHandler(fh) + class LogWrapper(object): """Wrapper for the WSGIServer which only calls write()"""