Even if you have slf4j and logback configured in your project, the c3p0 insists on writing log to system error channel like this:
The Eclipse console show log from c3p0 in red, because the texts are written to stderr. The way to dismiss those red part from c3p0 is add two lines at the beginning of your code.
public static void main(String[] args) {
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 your code
}
Here is the final result looks like. the redundant c3p0 log to stderr is gone.
0 comments:
Post a Comment