common: reduce jrpc exception spam

When a client repeatedly makes a request that results in an error
the log is spammed with tracebacks that don't provide significant
value.  The method name, code, and error message should be
enough for basic troubleshooting.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-07-09 13:44:21 -04:00
parent d51820f48c
commit 504a3a76f5
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 2 additions and 2 deletions

View File

@ -581,8 +581,8 @@ class JsonRPC:
) -> Dict[str, Any]:
if method_name:
method_name = f"Requested Method: {method_name}, "
log_msg = f"JSON-RPC Request Error - {method_name}Code: {code}\n{msg}"
if is_exc:
log_msg = f"JSON-RPC Request Error - {method_name}Code: {code}, Message: {msg}"
if is_exc and self.verbose:
logging.exception(log_msg)
else:
logging.info(log_msg)