I read the documentation but am unable to disable logging.
Messages like
09:38:01,996 INFO [STDOUT] 45147669 [http-0.0.0.0-8080-1] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd2e1f [managed: 3, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@307ae3)
are being logged all the time.
I am using c3p0 with hibernate, and I have log4j in the classpath.
In hibernate.cfg.xml I enable hibernate to use c3p0 by setting these properties:
<property name="hibernate.c3p0.initial_pool_size">10</property>
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.min_size">0</property>
<property name="hibernate.c3p0.timeout">5000</property> <!-- seconds before idle connection expires -->
<property name="hibernate.c3p0.idle_test_period">300</property><!-- check connection alive -->
<property name="hibernate.c3p0.acquire_increment">2</property>
Unsure how to disable loging, I added these in log4j.properties:
log4j.logger.com.mchange=NONE
log4j.logger.com.mchange.v2.c3p0=NONE
#log4j.logger.com.mchange.v2.c3p0.SQLWarnings=NONE
I also created c3p0.properties file:
###########################################################
# c3p0 property file
###########################################################
#enforce Log4J logging
com.mchange.v2.log.MLog=com.mchange.v2.log.log4j.Log4jMLog
#com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=OFF
com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=SEVERE
#com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=CONFIG
maxStatements=280
maxStatementsPerConnection=70
#com.mchange.v2.c3p0.SQLWarnings=NONE
==================================================
They are all located in the root(/) of the application's classpath.
The settings in hibernate.xfg.xml definitely take effect.
Is there a way to turn c3p0 logging off or change it to INFO instead of DEBUG without rebuilding the jar file with c3p0.debug=false and c3p0.trace=off?
Thanks!
Maxim
Nobody/Anonymous
None
None
Public
|
Date: 2007-03-14 22:55:52 PDT
|
|
Date: 2007-02-05 17:40:49 PST
|
|
Date: 2007-02-04 00:21:39 PST
|