Bug 1325072
Summary: | "virtlogd --verbose" doesn't output verbose messages | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Fangge Jin <fjin> |
Component: | libvirt | Assignee: | Jaroslav Suchanek <jsuchane> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7.3 | CC: | dyuan, jsuchane, mzhan, rbalakri, yafu, yanqzhan, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-2.0.0-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:41:28 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Fangge Jin
2016-04-08 07:00:40 UTC
Seems that cmdline override should be done before outputs definition. This may help: diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 68f0647..ac897b2 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -405,6 +405,12 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config, virLogParseOutputs(config->log_outputs); /* + * Command line override for --verbose + */ + if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO)) + virLogSetDefaultPriority(VIR_LOG_INFO); + + /* * If no defined outputs, and either running * as daemon or not on a tty, then first try * to direct it to the systemd journal @@ -464,12 +470,6 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config, VIR_FREE(tmp); } - /* - * Command line override for --verbose - */ - if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO)) - virLogSetDefaultPriority(VIR_LOG_INFO); - return 0; error: Fixed upstream by: commit c59b9e1483ca50290f865737877358978d88dfc7 Author: Jaroslav Suchanek <jsuchane> AuthorDate: Tue Jun 28 13:05:30 2016 +0200 Commit: Erik Skultety <eskultet> CommitDate: Tue Jun 28 13:52:34 2016 +0200 logging: fixing log level initialization from cmdline Reorder code for setting default log level from cmdline prior initialization of log outputs. Thus the --verbose option is reflected. This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325072 Reproduce this bug with libvirt-1.3.3-1.el7.x86_64. Steps to reproduce: 0.Don't change log setting in /etc/libvirt/virtlogd.conf: 1.# systemctl stop virtlogd 2.# virtlogd --verbose (nothing output) ^C 3.Change log_level to 3 or 4, the result is same with step 2. 4.Change log_level to 2: # vim /etc/libvirt/virtlogd.conf log_level = 2 5. # virtlogd --verbose 2016-07-06 02:15:13.201+0000: 31272: info : libvirt version: 1.3.3, package: 1.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2016-04-06-04:13:31, x86-034.build.eng.bos.redhat.com) 2016-07-06 02:15:13.201+0000: 31272: info : hostname: hostB 2016-07-06 02:15:13.201+0000: 31272: info : virObjectNew:202 : OBJECT_NEW: obj=0x7f52fb1ddd00 classname=virNetServer 2016-07-06 02:15:13.201+0000: 31272: info : virObjectNew:202 : OBJECT_NEW: obj=0x7f52fb1e0090 classname=virNetDaemon ...... Verify this bug with libvirt-2.0.0-1.el7.x86_64 Steps to verify: 0.Don't change log setting in /etc/libvirt/virtlogd.conf: 1.# systemctl stop virtlogd 2.# virtlogd --verbose 2016-07-05 05:42:21.381+0000: 8151: info : libvirt version: 2.0.0, package: 1.el7 (Unknown, 2016-07-01-15:41:46, hostA) 2016-07-05 05:42:21.381+0000: 8151: info : hostname: hostB 2016-07-05 05:42:21.381+0000: 8151: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fc3c3d8ccd0 classname=virNetServer ...... 3.Change log_level to 3 or 4, retest step 1-2, the result is same with step 2. 4.Change log_level to 2, the result is same with step 2. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html |