Hello Nir Soffer, Francesco Romani, Michal Skrivanek,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/60098
to review the following change.
Change subject: rpc: Log calls of API methods with possibly large results
......................................................................
rpc: Log calls of API methods with possibly large results
We can prevent some API methods from logging their excessively large
results. But this doesn't mean we shouldn't log their calls at all, we
just shouldn't log the large values.
This patch re-enables logging calls of the methods with suppressed
logging, it just disables logging their outputs.
Change-Id: I85d7f0ceee7e120081e2d9ad4ca3c8148ee70554
Bug-Url: https://bugzilla.redhat.com/1351247
Backport-To: 4.0
Backport-To: 3.6
Signed-off-by: Milan Zamazal <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/58464
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Michal Skrivanek <[email protected]>
Reviewed-by: Nir Soffer <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/58709
Continuous-Integration: Francesco Romani <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/59993
---
M lib/yajsonrpc/__init__.py
M vdsm/rpc/bindingxmlrpc.py
2 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/60098/1
diff --git a/lib/yajsonrpc/__init__.py b/lib/yajsonrpc/__init__.py
index 5aa950f..f279760 100644
--- a/lib/yajsonrpc/__init__.py
+++ b/lib/yajsonrpc/__init__.py
@@ -497,8 +497,7 @@
self._attempt_log_stats()
mangledMethod = req.method.replace(".", "_")
logLevel = logging.DEBUG
- if mangledMethod in ('Host_getAllVmStats',):
- logLevel = logging.TRACE
+ suppress_logging = mangledMethod in ('Host_getAllVmStats',)
# VDSM should never respond to any request before all information about
# running VMs is recovered, see https://bugzilla.redhat.com/1339291
@@ -539,8 +538,9 @@
req.id))
else:
res = True if res is None else res
+ log_res = "(suppressed)" if suppress_logging else res
self.log.log(logLevel, "Return '%s' in bridge with %s",
- req.method, res)
+ req.method, log_res)
ctx.requestDone(JsonRpcResponse(res, None, req.id))
@traceback(on=log.name)
diff --git a/vdsm/rpc/bindingxmlrpc.py b/vdsm/rpc/bindingxmlrpc.py
index 9c1562c..47e80ac 100644
--- a/vdsm/rpc/bindingxmlrpc.py
+++ b/vdsm/rpc/bindingxmlrpc.py
@@ -1219,8 +1219,7 @@
def wrapper(*args, **kwargs):
try:
logLevel = logging.DEBUG
- if f.__name__ in ('getAllVmStats',):
- logLevel = logging.TRACE
+ suppress_logging = f.__name__ in ('getAllVmStats',)
suppress_args = f.__name__ in ('fenceNode',)
# TODO: This password protection code is fragile and ugly. Password
@@ -1267,8 +1266,9 @@
res = f(*args, **kwargs)
else:
res = errCode['recovery']
+ log_res = "(suppressed)" if suppress_logging else res
f.__self__.cif.log.log(logLevel, 'return %s with %s',
- f.__name__, res)
+ f.__name__, log_res)
return res
except libvirt.libvirtError as e:
f.__self__.cif.log.error("libvirt error", exc_info=True)
--
To view, visit https://gerrit.ovirt.org/60098
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85d7f0ceee7e120081e2d9ad4ca3c8148ee70554
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Milan Zamazal <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]