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