diff --git a/src/Proto.Cluster/ClusterConfig.cs b/src/Proto.Cluster/ClusterConfig.cs index 68f233f600..b194daf8e2 100644 --- a/src/Proto.Cluster/ClusterConfig.cs +++ b/src/Proto.Cluster/ClusterConfig.cs @@ -328,6 +328,12 @@ public ClusterConfig WithClusterContextProducer(Func p /// public ClusterConfig WithGossipRequestTimeout(TimeSpan timeout) => this with { GossipRequestTimeout = timeout }; + /// + /// Enables debug logging for the gossip protocol. + /// + /// + /// + public ClusterConfig WithGossipDebugLogging(bool enabled = true) => this with { GossipDebugLogging = enabled }; /// /// TTL for remote PID cache. Default is 15min. Set to to disable. /// diff --git a/src/Proto.Cluster/Gossip/GossipActor.cs b/src/Proto.Cluster/Gossip/GossipActor.cs index 0d17a29896..1514e4f414 100644 --- a/src/Proto.Cluster/Gossip/GossipActor.cs +++ b/src/Proto.Cluster/Gossip/GossipActor.cs @@ -134,6 +134,11 @@ private Task OnGossipRequest(IContext context, GossipRequest gossipRequest) ReceiveState(context, gossipRequest.State); + + if (context.Cluster().Config.GossipDebugLogging) + { + Logger.LogInformation("Responding to GossipRequest {Request} to {MemberId}", gossipRequest, gossipRequest.MemberId); + } context.Respond(new GossipResponse());