Skip to content

Commit

Permalink
Move logs in message handlers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
t-bast committed Jul 15, 2024
1 parent 14e8043 commit f52c807
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
Expand Down

0 comments on commit f52c807

Please sign in to comment.