Francesco Romani has uploaded a new change for review.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
api: allow setLogLevel to tune a specific logger
the not widely known setLogLevel VDSM verb allows to dinamically tune the log level of the root logger, until the next restart of VDSM.
This patch extends the API to let the client tune any specific logger.
Change-Id: I8f40488fac04031552f36b9de026a0062ab81db0 Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/API.py M vdsm/rpc/BindingXMLRPC.py M vdsm/rpc/vdsmapi-schema.json 3 files changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/38426/1
diff --git a/vdsm/API.py b/vdsm/API.py index 85478b1..593f336 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1360,7 +1360,7 @@
return {'status': doneCode, 'info': stats}
- def setLogLevel(self, level): + def setLogLevel(self, level, name=None): """ Set verbosity level of vdsm's log.
@@ -1382,8 +1382,10 @@ except KeyError: return errCode['unavail'] else: - logging.info('Setting loglevel to %s (%d)', level, log_level) - _set_log_level(logging.getLogger(), log_level) + logger = logging.getLogger(name) + logging.info('Setting loglevel on %s to %s (%d)', + logger.name, level, log_level) + _set_log_level(logger, log_level) return {'status': doneCode}
# VM-related functions diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py index b01b661..ea0e0c3 100644 --- a/vdsm/rpc/BindingXMLRPC.py +++ b/vdsm/rpc/BindingXMLRPC.py @@ -583,9 +583,9 @@ return api.fenceNode(addr, port, agent, username, password, action, secure, options, policy)
- def setLogLevel(self, level): + def setLogLevel(self, level, name=None): api = API.Global() - return api.setLogLevel(level) + return api.setLogLevel(level, name)
def setMOMPolicy(self, policy): api = API.Global() diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json index 1d919e8..854e7aa 100644 --- a/vdsm/rpc/vdsmapi-schema.json +++ b/vdsm/rpc/vdsmapi-schema.json @@ -4030,10 +4030,14 @@ # # @level: The new verosity level desired # +# @name: #optional If present, change settings only for the logger +# with this name. Otherwise, change settings for the top-level +# logger (new in version 4.17.0). +# # Since: 4.10.0 ## {'command': {'class': 'Host', 'name': 'setLogLevel'}, - 'data': {'level': 'LoggingLevel'}} + 'data': {'level': 'LoggingLevel', '*name': 'str'}}
## # @Host.setSafeNetworkConfig:
automation@ovirt.org has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/16305/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/15505/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/16475/ : SUCCESS
automation@ovirt.org has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 2:
Build Started (1/2) -> http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/18356/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 2:
Build Started (2/2) -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/1586/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/18356/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/1586/ : SUCCESS
automation@ovirt.org has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: api: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 6:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 7:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 8:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 9:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 10:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 11:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 16:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Piotr Kliczewski has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 16:
(2 comments)
https://gerrit.ovirt.org/#/c/38426/16//COMMIT_MSG Commit Message:
PS16, Line 9: the not widely known Not so known?
https://gerrit.ovirt.org/#/c/38426/16/vdsm/API.py File vdsm/API.py:
Line 1370: Set verbosity level of vdsm's log. Line 1371: Line 1372: params Line 1373: level: requested logging level. `logging.DEBUG` `logging.ERROR` Line 1374: We have nice docstring here. Please add name description here. Line 1375: Doesn't survive a restart Line 1376: """ Line 1377: try: Line 1378: logUtils.set_level(level)
Dan Kenigsberg has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 16: Code-Review+1
(1 comment)
https://gerrit.ovirt.org/#/c/38426/16//COMMIT_MSG Commit Message:
PS16, Line 9: i y
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 17:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Piotr Kliczewski has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 17:
(1 comment)
https://gerrit.ovirt.org/#/c/38426/17//COMMIT_MSG Commit Message:
PS17, Line 9: Te not so known setLogLevel VDSM verb allows to dinamically tune Please fix comments from previous patch set
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 18:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 17:
(1 comment)
https://gerrit.ovirt.org/#/c/38426/17//COMMIT_MSG Commit Message:
PS17, Line 9: Te not so known setLogLevel VDSM verb allows to dinamically tune
Please fix comments from previous patch set
Done in PS#18, sorry for letting this slip repeatedly. I noticed the docstring of API.VM.setLogLevel is not consistent with the others in the module, fixed in a later patch.
Piotr Kliczewski has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 18:
(1 comment)
https://gerrit.ovirt.org/#/c/38426/18//COMMIT_MSG Commit Message:
PS18, Line 9: Te what about here :)
Francesco Romani has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 18:
(1 comment)
https://gerrit.ovirt.org/#/c/38426/18//COMMIT_MSG Commit Message:
PS18, Line 9: Te
what about here :)
Oops, fixed.
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 19:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 19: Verified+1
verified changing log levels to various loggers using vdsClient, and checking the effect on the log files.
Piotr Kliczewski has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 19: Code-Review+1
Milan Zamazal has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 19: Code-Review+1
(1 comment)
https://gerrit.ovirt.org/#/c/38426/15/vdsm/API.py File vdsm/API.py:
PS15, Line 1382:
It is mentioned in the initial paragraph here:
As I understand the documentation, it talks about `name' argument, not attribute. But I don't expect the attribute to disappear easily anyway.
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 20:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 21:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 21: Verified+1
re-verified as before
Piotr Kliczewski has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 21: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 22:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Dan Kenigsberg has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 22: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
API: allow setLogLevel to tune a specific logger
The not so known setLogLevel VDSM verb allows to dynamically tune the log level of the root logger, until the next restart of VDSM.
This patch extends the API to let the client tune any specific logger.
Change-Id: I8f40488fac04031552f36b9de026a0062ab81db0 Backports-To: 4.0 Backports-To: 3.6 Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: https://gerrit.ovirt.org/38426 Reviewed-by: Piotr Kliczewski piotr.kliczewski@gmail.com Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg danken@redhat.com --- M client/vdsClient.py M lib/api/vdsm-api.yml M lib/vdsm/logUtils.py M lib/vdsm/rpc/bindingxmlrpc.py M vdsm/API.py 5 files changed, 29 insertions(+), 14 deletions(-)
Approvals: Piotr Kliczewski: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified
gerrit-hooks has posted comments on this change.
Change subject: API: allow setLogLevel to tune a specific logger ......................................................................
Patch Set 23:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org