mybatis依赖
<!-- mybatis依赖 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version> </dependency> <!-- mysql驱动 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> <scope>runtime</scope> </dependency>
application.properties配置mybatis
#配置mybatis ## 配置数据源信息 spring.datasource.username=数据库用户名 spring.datasource.password=数据库密码 spring.datasource.url=jdbc:mysql://localhost:3306/数据库名?characterEncoding=utf-8 spring.datasource.driver-class-name=com.mysql.jdbc.Driver
application.properties配置mybatis输出日志
## 整个项目的日志级别 logging.level.com.shenke=debug ## 颗粒度更细的mybatis日志 # logging.level.com.shenke.dao=debug # 颗粒度更细的spring日志 logging.level.org.org.springframework=debug #让AOP日志处理类可以把日志写入日志文件,并在控制台输出 logging.level.com.shenke.logger=debug #把日志写入特定文件中 logging.file.name=E://mylog/log.txt
创建xml配置文件
标签:logging,springboot,level,spring,mybatis,mysql,myBatis,日志 From: https://www.cnblogs.com/liweimingbk/p/17066029.html