Merge pull request #24 from p2p-org/logging

Logging
This commit is contained in:
Vyacheslav Shebanov
2022-09-22 22:21:04 +03:00
committed by GitHub
3 changed files with 6 additions and 1 deletions

View File

@@ -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)

View File

@@ -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, _ ->

View File

@@ -26,6 +26,10 @@
<!-- Reactor Netty produces warnings that are ok,
ex. when Dshackle closes a connection too fast and Reactor Netty HTTPClient doesn't like that -->
<Logger name="io.grpc.netty" level="error" additivity="false">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="STDERR" level="warn"/>
</Logger>
<Logger name="reactor.netty.http.client" level="error" additivity="false">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="STDERR" level="warn"/>