how do I turn off logging in java c3p0 connection pooling lib?

前端 未结 6 1914
温柔的废话
温柔的废话 2020-12-08 19:07

hey all, I\'m just getting started with c3p0 for database connection pooling. It\'s attaching itself to my log4j output currently. How do I set logging off or at least to SE

6条回答
  •  春和景丽
    2020-12-08 19:42

    For those who are NOT using a configuration file, just to add the following in the code, before loading the connection pool.

    Properties p = new Properties(System.getProperties());
    p.put("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
    p.put("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "OFF"); // Off or any other level
    System.setProperties(p);
    

提交回复
热议问题