Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 162543 Details for
Bug 253890
add persistent logging to virt-install
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Upstream patch redone for RHEL-5.
add-persistent-logging.patch (text/plain), 2.67 KB, created by
Flavio Leitner
on 2007-08-22 17:48:07 UTC
(
hide
)
Description:
Upstream patch redone for RHEL-5.
Filename:
MIME Type:
Creator:
Flavio Leitner
Created:
2007-08-22 17:48:07 UTC
Size:
2.67 KB
patch
obsolete
># HG changeset patch ># User "Daniel P. Berrange <berrange@redhat.com>" ># Date Fri May 18 09:22:14 2007 -0400 ># Node ID e11462a77df5f08fd491736c89e93b0a487aa3e9 ># parent: 0ad5a9b329571a5cc7bce5fde9156aacc0c2cee7 >Added persistent logging ( Nobuhiro Itou ) > >Index: virtinst-0.103.0/virt-install >=================================================================== >--- virtinst-0.103.0.orig/virt-install >+++ virtinst-0.103.0/virt-install >@@ -19,6 +19,7 @@ from optparse import OptionParser, Optio > import subprocess > import struct > import logging >+import logging.handlers > import libxml2 > import urlgrabber.progress as progress > >@@ -26,6 +27,29 @@ import libvirt > import virtinst > > MIN_RAM = 256 >+MAX_LOGSIZE = 1024 * 1024 # 1MB >+ROTATE_NUM = 5 >+DIR_NAME = ".virt-install" >+FILE_NAME = "virt-install.log" >+FILE_MODE = 'a' >+FILE_FORMAT = "[%(asctime)s virt-install %(process)d] %(levelname)s (%(module)s:%(lineno)d) %(message)s" >+STREAM_FORMAT = "%(asctime)s %(levelname)-8s %(message)s" >+DATEFMT = "%a, %d %b %Y %H:%M:%S" >+ >+# set up logging >+vi_dir = os.path.expanduser("~/%s" % DIR_NAME) >+if not os.access(vi_dir,os.W_OK): >+ try: >+ os.mkdir(vi_dir) >+ except IOError, e: >+ raise RuntimeError, "Could not create %d directory: " % vi_dir, e >+ >+filename = "%s/%s" % (vi_dir, FILE_NAME) >+rootLogger = logging.getLogger() >+rootLogger.setLevel(logging.DEBUG) >+fileHandler = logging.handlers.RotatingFileHandler(filename, FILE_MODE, MAX_LOGSIZE, ROTATE_NUM) >+fileHandler.setFormatter(logging.Formatter(FILE_FORMAT, DATEFMT)) >+rootLogger.addHandler(fileHandler) > > ### Utility functions > def yes_or_no(s): >@@ -475,16 +499,13 @@ def show_console(dom): > def main(): > options = parse_args() > >+ streamHandler = logging.StreamHandler(sys.stderr) >+ streamHandler.setFormatter(logging.Formatter(STREAM_FORMAT, DATEFMT)) > if options.debug: >- logging.basicConfig(level=logging.DEBUG, >- format="%(asctime)s %(levelname)-8s %(message)s", >- datefmt="%a, %d %b %Y %H:%M:%S", >- stream=sys.stderr) >+ streamHandler.setLevel(logging.DEBUG) > else: >- logging.basicConfig(level=logging.ERROR, >- format="%(asctime)s %(levelname)-8s %(message)s", >- datefmt="%a, %d %b %Y %H:%M:%S", >- stream=sys.stderr) >+ streamHandler.setLevel(logging.ERROR) >+ rootLogger.addHandler(streamHandler) > > conn = libvirt.open(options.connect) > type = None >@@ -630,4 +651,8 @@ def main(): > > > if __name__ == "__main__": >- main() >+ try: >+ main() >+ except Exception, e: >+ logging.exception(e) >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 253890
: 162543