javac3p0

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


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 SEVERE level only for c3p0? I tried tweaking the properties file but not sure it's being picked up properly.

any ideas on how best to turn it off?

thanks

UPDATE: this seems to work in the log4j.properties file

log4j.logger.com.mchange.v2.c3p0.impl=INFO

log4j.logger.com.mchange=INFO

Solution

  • If you use a log4j.xml file you can simple define a logger for the c3po package:

    <logger name="com.mchange.v2.c3p0">
        <level value="SEVERE"/>
    </logger>
    

    There are analogous methods for log4j.properties. I think it's just:

    log4j.logger.com.mchange.v2.c3p0=SEVERE