Akka cluster: how to disable ClusterHeartbeat log

为君一笑 提交于 2019-12-12 00:28:24

问题


I'm playing a bit with an Akka cluster and I had a setup with 2 nodes. As expected, the two nodes chat each other to say that they are alive through the heartbeat. So every second I have a string like this in my log

[debug] 15:42:10.683-a.c.ClusterHeartbeatSender: Cluster Node  
[akka.tcp://application@127.0.0.1:52650] - 
Heartbeat to   [akka.tcp://application@127.0.0.1:2551]

However I wouldn't like to see this diagnostic, since it hides my debug information and I'm quite sure that the cluster works since is made up of two JVMs on my machine. I tried to change the configuration with

akka.cluster.log-info = off

but it does not seem to work for this case. How can hide this info from logs?


回答1:


I solved using this other question about changing log level for a specific class or package. I leave question and answer for future reader looking for quick solution. In my case I added this row

<logger name="akka.cluster.ClusterHeartbeatSender" level="OFF"/>

to root of logger.xml file



来源:https://stackoverflow.com/questions/29921499/akka-cluster-how-to-disable-clusterheartbeat-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!