Redirect yum's logging to yum.log
This commit is contained in:
parent
a44e499eee
commit
3e5c0707bb
@ -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
|
||||
|
||||
|
@ -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()"""
|
||||
|
Loading…
Reference in New Issue
Block a user