log4jdbc xml配置不起作用

时间:2018-07-16 11:48:06

标签: logging jdbc configuration log4jdbc

无论我如何设置配置文件,它始终会输出相同的结果。

我在这里做什么错了?

这是我的logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<include resource = "org/springframework/boot/logging/logback/base.xml"></include>
<logger name="jdbc.sqlonly"             level="WARN"/>
<logger name="jdbc.sqltiming"           level="WARN"/>
<logger name="jdbc.audit"               level="WARN"/>
<logger name="jdbc.resultset"           level="WARN"/>
<logger name="jdbc.resultsettable"      level="WARN"/>
<logger name="jdbc.connection"          level="WARN"/>

</configuration>

和根上下文

<beanid="dataSource"lass="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"value="net.sf.log4jdbc.sql.jdbcapi.DriverSpy"></property>
<property name="url"value="jdbc:log4jdbc:mysql://localhost:3306/junpersonal?serverTimezone=UTC">
</property>
<property name="username" value="userid"></property>
<property name="password" value="pwd"></property>
</bean>

0 个答案:

没有答案