1

我有MongoDB 3.2.9并且我正在开发一个 Java 应用程序,Jongo 1.3.0NetBeans控制台显示下一条红色消息:

nov 24, 2016 2:30:17 AM com.mongodb.diagnostics.logging.JULLogger log
INFORMACIÓN: Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
nov 24, 2016 2:30:18 AM com.mongodb.diagnostics.logging.JULLogger log
INFORMACIÓN: Opened connection [connectionId{localValue:1, serverValue:86}] to localhost:27017
nov 24, 2016 2:30:18 AM com.mongodb.diagnostics.logging.JULLogger log
INFORMACIÓN: Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 2, 9]}, minWireVersion=0, maxWireVersion=4, maxDocumentSize=16777216, roundTripTimeNanos=4886848}
nov 24, 2016 2:30:19 AM com.mongodb.diagnostics.logging.JULLogger log
INFORMACIÓN: Opened connection [connectionId{localValue:2, serverValue:87}] to localhost:27017

由于这个项目是大学作业,我的老师会说我这是一个问题;出于这个原因,我想删除这些消息或更改其颜色。

作为我正在使用的附加信息:

  • bson4jackson-2.7.0.jar
  • jackson-annotations-2.7.3.jar
  • 杰克逊核心-2.7.3.jar
  • jackson-databind-2.7.3.jar
  • mongo-java-driver-3.2.2.jar

...当我更改mongo-java-driver版本时,我的应用程序无法正常工作。

这是我的java代码:

collection = (new Jongo(new MongoClient( "localhost" , 27017 ).getDB("mydb"))).getCollection("mycollection");
4

1 回答 1

1

感谢你所做的一切。这是我的解决方案:

Logger mongoLogger = Logger.getLogger( "org.mongodb.driver" );
mongoLogger.setLevel(Level.SEVERE); 
于 2016-11-24T17:15:35.290 回答