web的项目 2.0 调用封装方法
log.info("输出sql:" + remoteSqlDTO.getSql());
log.info("输出参数:" + JSON.toJSONString(params));
web的项目 1.0 通用sql日志输出
# MyBatis
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.powerpeak.truck
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath:mybatis/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
文章介绍了在Web项目从1.0到2.0升级过程中,如何实现SQL日志的封装,通过log.info记录SQL语句及其参数。同时,展示了MyBatis的相关配置,包括设置typeAliasesPackage,mapperLocations,configLocation以及启用日志实现类StdOutImpl。
466

被折叠的 条评论
为什么被折叠?



