Hibernate

log4j.logger.org.hibernate.tool.hbm2ddl=debug
log4j.logger.org.hibernate.engine.transaction=debug

 

Mybatis

在mybatis配置中添加下面的配置

1 <settings>
2     <setting name="logImpl" value="LOG4J" />
3 </settings>

在spring的SqlSessionFactory配置中添加以下配置

1 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
2     <property name="configuration">
3         <bean class="org.apache.ibatis.session.Configuration">
4             <property name="logImpl" value="org.apache.ibatis.logging.log4j.Log4jImpl" />
5         </bean>
6     </property>
7 </bean>

在项目中的dao层中修改Level

com.mybatis.demo.dao=debug

 

相关文章:

  • 2021-09-14
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-10-28
猜你喜欢
  • 2021-06-30
  • 2021-03-30
  • 2018-08-16
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案