1.mybatis配置
主要配置log-impl属性,如果只在控制台打印配置org.apache.ibatis.logging.stdout.StdOutImpl,下面的配置是输出到日志文件
mybatis:
mapper-locations: classpath*:**/*Mapper.xml
typeAliasesPackage: com.xx.**.domain
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
jdbc-type-for-null: 'null'
call-setters-on-nulls: true
2.logback配置,打印到控制台不需要配置,这里只展示关键代码
创建logger,com.xx.xx.mapper对应项目中mapper包,file_log是appender输出源
<logger name="com.xx.xx.mapper" additivity="false" level="DEBUG">
<appender-ref ref="file_log" />
</logger>
|