Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cluster heartbeat logging in Akka.NET

When trying to troubleshoot a cluster setup in Akka.NET the cluster heartbeat messages are filling up the log.

[DEBUG][8/9/2016 6:04:32 PM][Thread 0011][[akka://mysystem/system/cluster/core/daemon#1680718572]] [Initialized] Received Akka.Cluster.GossipStatus

Is there a way to prevent this log event selectively as there appears to be possible with Akka for JVM?

like image 556
jpierson Avatar asked Mar 12 '23 11:03

jpierson


1 Answers

I faced the same issue. There were too many gossip messages in the log and I wanted to prevent this.

Here is a solution.

https://github.com/akkadotnet/akka.net/blob/v1.1.2/src/core/Akka.Cluster/Configuration/Cluster.conf#L77

So to avoid polluting the log with GossipStatus messages like this one (similar to your example):

[DEBUG][2016-12-26 1:48:36 PM][Thread 0004][[akka://mysystem/system/cluster/core/daemon#1458732427]] [Initialized] Received Akka.Cluster.GossipStatus

You just need to set the following option off:

cluster {
    log-info = off
}

Meantime if you have remote option turned on like this:

remote {
    log-received-messages = on
}

Then you will still have some cluster gossip messages logged (as @Aaronontheweb mentioned), but these messages are different. Compare for example with this:

[DEBUG][2016-12-26 1:41:03 PM][Thread 0008][[akka://mysystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fmysystem%40127.0.0.1%3A4053-1/endpointWriter#1021888826]] received local message [RemoteMessage: Akka.Cluster.ClusterHeartbeatSender+HeartbeatRsp to [akka://mysystem/system/cluster/core/daemon/heartbeatSender#647951916]<+akka://mysystem/system/cluster/core/daemon/heartbeatSender from [akka.tcp://[email protected]:4053/system/cluster/heartbeatReceiver#497245242]]
[DEBUG][2016-12-26 1:41:04 PM][Thread 0010][[akka://mysystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fmysystem%40127.0.0.1%3A4053-1/endpointWriter#1021888826]] received local message [RemoteMessage: ActorSelectionMessage - Message: Akka.Cluster.GossipStatus - WildCartFanOut: False - Elements: system/cluster/core/daemon to [akka://mysystem/]<+akka://mysystem/ from [akka.tcp://[email protected]:4053/system/cluster/core/daemon#1365688409]]
[DEBUG][2016-12-26 1:41:04 PM][Thread 0009][[akka://mysystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fmysystem%40127.0.0.1%3A4053-1/endpointWriter#1021888826]] received local message [RemoteMessage: ActorSelectionMessage - Message: Akka.Cluster.ClusterHeartbeatSender+Heartbeat - WildCartFanOut: False - Elements: system/cluster/heartbeatReceiver to [akka://mysystem/]<+akka://mysystem/ from [akka.tcp://[email protected]:4053/system/cluster/core/daemon/heartbeatSender#2069081679]]
like image 68
gordey4doronin Avatar answered Mar 14 '23 01:03

gordey4doronin