unfortunately, c3p0's loggers are defined on a per-class, not per-instance basis, so there's not an easy way to segregate logging by instance. loggers are very fine-grained by class though; to avoid some of the noise you can set permissive log-levels only on the classes that most interest you.
Separate log file for c3p0 datasource
-
31-08-2022 - |
Pergunta
We have several datasources in our project. c3p0 used as jdbc connecton pool.
Log file contains mixed datasources output. Is it posible to create separate log file for each datasource?
Spring configutaion file:
<bean id="firstDS" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<properties/>
/bean>
<bean id="secondDS" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<properties/>
</bean>
Log4j configuration:
<logger name="com.mchange.v2" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="c3p0.appender"/>
</logger>
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow