how to prevent logging on console when connected to mongodb from java?

前端 未结 4 1821
醉话见心
醉话见心 2021-01-04 10:25

I followed this mongodb documentation. Here is my code

public class JMongoDBCDemo
{
    MongoClient mongoClient;
    DB db;
    DBCollection coll;
    public         


        
4条回答
  •  一生所求
    2021-01-04 10:39

    Thanks to @jyemin By using MongoDB official documentation link

    Logger mongoLogger = Logger.getLogger( "org.mongodb.driver" );
    mongoLogger.setLevel(Level.SEVERE); 
    

    Now no logs are there in the console.

提交回复
热议问题