From 0a90c599a1b96f78dea949966d4298e1299dacac Mon Sep 17 00:00:00 2001 From: Maxksim Fomenkov Date: Thu, 22 Sep 2022 20:06:34 +0300 Subject: [PATCH 1/2] hide unnecessary logs --- src/main/resources/log4j2.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index ffabce8b..08e5d92d 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -26,6 +26,10 @@ + + + + From 1c52b649deeda362d0ebebc9a6dbed3168809726 Mon Sep 17 00:00:00 2001 From: Maxksim Fomenkov Date: Thu, 22 Sep 2022 20:06:47 +0300 Subject: [PATCH 2/2] better logging --- .../kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt | 2 +- .../kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt index fbe72bf4..4a8911b9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt @@ -161,7 +161,7 @@ class QuorumRpcReader( is JsonRpcException -> err else -> JsonRpcException( JsonRpcResponse.NumberId(key.id), - JsonRpcError(-32603, "Unhandled internal error: ${err.javaClass}") + JsonRpcError(-32603, "Unhandled internal error: ${err.javaClass}: ${err.message}") ) } quorum.record(cleanErr, null, api) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt index d8434fbe..2b9ece14 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt @@ -80,6 +80,7 @@ class GrpcHead( .setTypeValue(chain.id) .build() return client.subscribeHead(chainRef) + .doOnError { log.error("subscribeHead err: ${it.message}", it) } // simple retry on failure, if eventually failed then it supposed to resubscribe later from outer method .retryWhen(Retry.backoff(4, Duration.ofSeconds(1))) .onErrorContinue { err, _ ->