From f52c807c53e7fbf772e97035163baa1e82b1bbbc Mon Sep 17 00:00:00 2001 From: t-bast Date: Mon, 15 Jul 2024 09:36:00 +0200 Subject: [PATCH] Move logs in message handlers Log messages that are outside of a message handler are not decorated with MDC fields. We move all logging calls to message handlers to ensure that they have the MDC fields. --- .../src/main/scala/fr/acinq/eclair/io/MessageRelay.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/io/MessageRelay.scala b/eclair-core/src/main/scala/fr/acinq/eclair/io/MessageRelay.scala index 79f86693e0..a25a166913 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/io/MessageRelay.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/io/MessageRelay.scala @@ -126,6 +126,7 @@ private class MessageRelay(nodeParams: NodeParams, replyTo_opt.foreach(_ ! UnknownChannel(messageId, channelId)) Behaviors.stopped case WrappedOptionalNodeId(Some(nextNodeId)) => + log.info("found outgoing node {} for channel {}", nextNodeId, channelId) withNextNodeId(msg, nextNodeId) } } @@ -151,7 +152,6 @@ private class MessageRelay(nodeParams: NodeParams, switchboard ! GetPeerInfo(context.messageAdapter(WrappedPeerInfo), prevNodeId) waitForPreviousPeerForPolicyCheck(msg, nextNodeId) case RelayAll => - log.info("connecting to {} to relay onion message", nextNodeId) switchboard ! Peer.Connect(nextNodeId, None, context.messageAdapter(WrappedConnectionResult).toClassic, isPersistent = false) waitForConnection(msg, nextNodeId) }