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
|
from glob import glob
|
||||||
import os
|
import os
|
||||||
import yum
|
import yum
|
||||||
|
# This is a hack to short circuit yum's internal logging
|
||||||
|
yum.logginglevels._added_handlers = True
|
||||||
|
|
||||||
from pylorax.sysutils import joinpaths
|
from pylorax.sysutils import joinpaths
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ log = logging.getLogger("lorax-composer")
|
|||||||
program_log = logging.getLogger("program")
|
program_log = logging.getLogger("program")
|
||||||
pylorax_log = logging.getLogger("pylorax")
|
pylorax_log = logging.getLogger("pylorax")
|
||||||
server_log = logging.getLogger("server")
|
server_log = logging.getLogger("server")
|
||||||
|
yum_log = logging.getLogger("yum")
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
@ -96,6 +97,13 @@ def setup_logging(logfile):
|
|||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
server_log.addHandler(fh)
|
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):
|
class LogWrapper(object):
|
||||||
"""Wrapper for the WSGIServer which only calls write()"""
|
"""Wrapper for the WSGIServer which only calls write()"""
|
||||||
|
Loading…
Reference in New Issue
Block a user