如何关闭java c3p0连接池lib中的日志记录? [英] how do I turn off logging in java c3p0 connection pooling lib?
问题描述
嘿所有,我刚刚开始使用c3p0进行数据库连接池。它当前附加到我的log4j输出。如何为c3p0设置注销或至少为SEVERE级别?我尝试调整属性文件,但不确定它是否被正确拾取。
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?
谢谢
更新:
这似乎适用于log4j.properties文件
UPDATE: this seems to work in the log4j.properties file
log4j.logger.com.mchange.v2.c3p0.impl=INFO
log4j.logger.com.mchange=INFO
推荐答案
如果你使用log4j.xml文件,你可以简单地为c3po包定义一个记录器:
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>
log4j.properties有类似的方法。我认为这只是:
There are analogous methods for log4j.properties. I think it's just:
log4j.logger.com.mchange.v2.c3p0=SEVERE
这篇关于如何关闭java c3p0连接池lib中的日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!