---
builder/kojid | 8 +++++++-
util/kojira | 2 +-
vm/kojivmd | 8 +++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/builder/kojid b/builder/kojid
index dcd0840..49c1510 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -4411,6 +4411,7 @@ def get_options():
parser.add_option("--debug-mock", action="store_true", default=False,
#obsolete option
help=SUPPRESS_HELP)
+ parser.add_option("--logfile", help="specify log file")
parser.add_option("--skip-main", action="store_true", default=False,
help="don't actually run main")
parser.add_option("--maxjobs", type='int', help="Specify maxjobs")
@@ -4445,6 +4446,7 @@ def get_options():
'minspace': 8192,
'admin_emails': None,
'log_level': None,
+ 'logfile': '/var/log/kojid.log',
'topdir': '/mnt/koji',
'topurl': None,
'workdir': '/var/tmp/koji',
@@ -4509,6 +4511,9 @@ def get_options():
if getattr(options, name, None) is None:
setattr(options, name, value)
+ if options.logfile in ('','None','none'):
+ options.logfile = None
+
#honor topdir
if options.topdir:
koji.BASEDIR = options.topdir
@@ -4549,7 +4554,8 @@ def quit(msg=None, code=1):
sys.exit(code)
if __name__ == "__main__":
- koji.add_file_logger("koji", "/var/log/kojid.log")
+ if options.logfile:
+ koji.add_file_logger("koji", options.logfile)
#note we're setting logging params for all of koji*
options = get_options()
if options.log_level:
diff --git a/util/kojira b/util/kojira
index c18f63b..86e6b80 100755
--- a/util/kojira
+++ b/util/kojira
@@ -779,7 +779,7 @@ if __name__ == "__main__":
if not os.access(options.logfile,os.W_OK):
sys.stderr.write("Cannot write to logfile: %s\n" % options.logfile)
sys.exit(1)
- koji.add_file_logger("koji", options.logfile)
+ koji.add_file_logger("koji", options.logfile)
#note we're setting logging for koji.*
logger = logging.getLogger("koji")
if options.debug:
diff --git a/vm/kojivmd b/vm/kojivmd
index cf44f0c..fa79e58 100755
--- a/vm/kojivmd
+++ b/vm/kojivmd
@@ -82,6 +82,7 @@ def get_options():
help="show xmlrpc debug output")
parser.add_option("--skip-main", action="store_true", default=False,
help="don't actually run main")
+ parser.add_option("--logfile", help="specify log file")
parser.add_option("--maxjobs", type='int', help="Specify maxjobs")
parser.add_option("--sleeptime", type='int', help="Specify the polling interval")
parser.add_option("--admin-emails", help="Address(es) to send error notices to")
@@ -108,6 +109,7 @@ def get_options():
'minmem': 4096,
'vmuser': 'qemu',
'admin_emails': None,
+ 'logfile': '/var/log/kojivmd.log',
'workdir': '/tmp/koji',
'topurl': '',
'imagedir': '/var/lib/libvirt/images',
@@ -153,6 +155,9 @@ def get_options():
if getattr(options, name, None) is None:
setattr(options, name, value)
+ if options.logfile in ('','None','none'):
+ options.logfile = None
+
#make sure workdir exists
if not os.path.exists(options.workdir):
koji.ensuredir(options.workdir)
@@ -1040,7 +1045,8 @@ class VMTaskManager(TaskManager):
####################
if __name__ == "__main__":
- koji.add_file_logger("koji", "/var/log/kojivmd.log")
+ if options.logfile:
+ koji.add_file_logger("koji", options.logfile)
#note we're setting logging params for all of koji*
options = get_options()
if options.debug:
--
1.9.3