This post covers how to disable c3p0 (database connection pooling) logs printing on console or writing in log files even you have configured SLF4J and logback/SLF4j and log4j.
This is the output of my logfile before disabling the c3p0 logs.
We can disable by adding these do the main method.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] { | |
System.setProperty("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "WARNING"); | |
System.setProperty("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); | |
// Rest of the code | |
} |
This is the log file output after the code modification.
Thank you for reading the post and hope it will help you.