Bug 1421556

Summary: Setting log level as shown in README.logging fails.
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: vdsmAssignee: Irit Goihman <igoihman>
Status: CLOSED ERRATA QA Contact: Lukas Svaty <lsvaty>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bazulay, lsurette, lsvaty, mperina, pstehlik, srevivo, ycui, ykaul
Target Milestone: ovirt-4.1.2Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-24 11:24:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Germano Veit Michel 2017-02-13 05:13:30 UTC
Description of problem:

This patch here is merged in 4.1:

logging: Improve log level alignment
https://gerrit.ovirt.org/#/c/64217/

It also shortened the log levels to be used with vdsm-client:
https://gerrit.ovirt.org/#/c/64217/4/README.logging

However, vdsm-client rejects the shortened log levels but still accepts the previous ones. 

See the problem when trying to set log levels accoring to README.logger

# vdsm-client Host setLogLevel level=WARN name=storage
vdsm-client: Command Host.setLogLevel with args {'name': 'storage', 'level': 'WARN'} failed:
(code=-32603, message=unknown log level: u'WARN')

# vdsm-client Host setLogLevel level=WARNING name=storage
true

# vdsm-client Host setLogLevel level=CRIT name=virt
vdsm-client: Command Host.setLogLevel with args {'name': 'virt', 'level': 'CRIT'} failed:
(code=-32603, message=unknown log level: u'CRIT')

# vdsm-client Host setLogLevel level=CRITICAL name=virt
true

Version-Release number of selected component (if applicable):
vdsm-4.19.4-1.el7ev.x86_64
vdsm-client-4.19.4-1.el7ev.noarch

How reproducible:
100%

Comment 1 Germano Veit Michel 2017-02-13 05:16:43 UTC
Hmm.. looks like this was already fixed on master but not backported to 4.1

https://gerrit.ovirt.org/71071

Comment 3 Lukas Svaty 2017-04-04 14:43:14 UTC
[root@localhost ~]# grep setLogLevel /usr/share/doc/vdsm-4.19.10.1/README.logging
# vdsClient [-s] SERVER setLogLevel LEVEL [LOGGER]
vdsClient -s 0 setLogLevel DEBUG
vdsClient -s 0 setLogLevel WARN virt
vdsClient -s 0 setLogLevel WARN storage
vdsClient -s 0 setLogLevel WARN jsonrpc
vdsClient -s 0 setLogLevel devel WARN


[root@localhost ~]# vdsClient -s 0 setLogLevel devel WARN
Unexpected exception

should be:
[root@localhost ~]# vdsClient -s 0 setLogLevel WARN devel


success \o/
do believe this should not happen -> Failed QA

Comment 4 Irit Goihman 2017-04-09 10:10:25 UTC
It looks like an error in logging documentation.
vdsClient expects arguments in a specific order: log level, log name.

Also, an 'unexpected exception' shouldn't be raised but a proper error message.

Comment 5 Irit Goihman 2017-04-09 10:46:07 UTC
The 'unexpected exception' error message is implemented in XMLRPC protocol, which is deprecated and replaced by JSONRPC - so it won't be fixed.

Comment 8 Lukas Svaty 2017-05-09 13:27:00 UTC
verified in vdsm-4.19.11-1.el7ev.x86_64

Comment 10 errata-xmlrpc 2017-05-24 11:24:48 UTC
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://access.redhat.com/errata/RHEA-2017:1281