我在春季申请中使用cassandra。每次请求到来或连接空闲时,cassandra都会通过我的应用程序的logback打印心跳DEBUG日志。我想在调试日志中停止这些心跳记录。
2016-11-03 11:37:27,241 DEBUG [cluster1-nio-worker-2] [com.datastax.driver.core.Connection] [line : 1093 ] [] - Connection[/10.41.123.31:9042-2, inFlight=0, closed=false] heartbeat query succeeded
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-6] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-6, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,991 DEBUG [cluster1-nio-worker-1] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-1, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-5] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-5, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-7] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-7, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,993 DEBUG [cluster1-nio-worker-5] [com.datastax.driver.core.Connection] [line : 1093 ] [] - Connection[/10.41.123.31:9042-5, inFlight=0, closed=false] heartbeat query succeeded
2016-1
答案 0 :(得分:0)
您使用的是什么记录器?
如果您使用的是log4j,则可以像这样配置调试级别:
import org.apache.log4j.PropertyConfigurator;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(Application.class);
public Application() {
final Properties properties = new Properties();
properties.put("log4j.rootLogger", "INFO, A1");
PropertyConfigurator.configure(properties);
}
然后不应再打印心跳了。