开发者社区> 问答> 正文

mongodb3.0.1如何关闭debug

在做mongodb3.0.1与java项目整合时候,发现后台总是在打印debug信息
2015-08-11 17:32:24.621 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:24.624 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=0.9 ms, state=CONNECTED}]
2015-08-11 17:32:25.363 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:25.365 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=0.6 ms, state=CONNECTED}]
2015-08-11 17:32:34.626 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:34.628 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=1.0 ms, state=CONNECTED}]
2015-08-11 17:32:35.367 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:35.369 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=0.7 ms, state=CONNECTED}]
2015-08-11 17:32:44.629 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:44.631 [cluster-ClusterId{value='55c9c11e80df810c54492c6b', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=1.1 ms, state=CONNECTED}]
2015-08-11 17:32:45.370 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Checking status of localhost:27017
2015-08-11 17:32:45.372 [cluster-ClusterId{value='55c9c11f80df810c54492c6c', description='null'}-localhost:27017] DEBUG o.mongodb.driver.cluster.debug(56) - Updating cluster description to {type=STAN
DALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=0.8 ms, state=CONNECTED}]

请问如何关闭mongodb的这个debug信息打印.

展开
收起
蛮大人123 2016-03-17 14:21:12 5697 0
1 条回答
写回答
取消 提交回答
  • 我使用了log4j,在log4j.properties中加入 log4j.logger.o.mongodb.driver.cluster=WARN ,就可以屏蔽debug信息

    2019-07-17 19:05:21
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Data as a Service - 数据即服务 -- MongoDB⾼级应⽤模式 立即下载
阿里云MongoDB云服务构建 立即下载
饿了么高级架构师陈东明:MongoDB是如何逐步提高可靠性的 立即下载