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

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);

Leave a Comment