摘要: 点击idea编译器的右上角的项目名称的下拉框箭头:然后点击该按钮:“Edit Configuration” 出来一下对话框,选中其中的项:“Enable debug output”,即可 注意: 该配置只会在本地环境生效,本地环境中日志配置文件上的日志等级会被该配置所覆盖。 但是离开了编译器之后,日 阅读全文
posted @ 2019-11-07 16:30 zhangxuezhi 阅读(17030) 评论(0) 推荐(0) 编辑
摘要: 文件名为: logback-spring.xml, 放在resources的根目录下,日志配置内容如下: <?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- 日志路径,可以读取application.yml文件的具体配置 --> < 阅读全文
posted @ 2019-11-07 16:18 zhangxuezhi 阅读(308) 评论(0) 推荐(0) 编辑
摘要: yml的配置文件格式如下: # 应用名称 application: name: PLAY # 环境配置 spring: profiles: active: dev #开发环境: application-dev.yml # active: prod #生产环境 # active: test #测试环境 阅读全文
posted @ 2019-11-07 15:45 zhangxuezhi 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 项目配置时区为中国上海: import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringAp 阅读全文
posted @ 2019-11-07 15:39 zhangxuezhi 阅读(8605) 评论(0) 推荐(0) 编辑
摘要: 首先引入swagger的依赖: <properties> <swagger2.version>2.9.2</swagger2.version> </properties> <!-- swagger api自动检测和显示 --> <dependency> <groupId>io.springfox</ 阅读全文
posted @ 2019-11-07 15:34 zhangxuezhi 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 需要引入web的依赖: <!-- spring boot web 组件 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </de 阅读全文
posted @ 2019-11-07 15:26 zhangxuezhi 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 首先引入fastJson的依赖: <properties> <fastjson.version>1.2.15</fastjson.version> </properties> <!-- fastjson 数据json格式化工具 --> <dependency> <groupId>com.alibab 阅读全文
posted @ 2019-11-07 15:22 zhangxuezhi 阅读(773) 评论(0) 推荐(0) 编辑
摘要: 首先引入web模块的依赖: <!-- spring boot web 组件 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </ 阅读全文
posted @ 2019-11-07 15:16 zhangxuezhi 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 今天在 PLAY项目里面, 要配置一个aop,拦截controller的所有请求,把入参都记录下来。 步骤1:引入aop的依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star 阅读全文
posted @ 2019-11-07 14:50 zhangxuezhi 阅读(1256) 评论(0) 推荐(0) 编辑
摘要: 今天在代码调试过程中,在通过swagger调试某个接口(restful api)的时候,遇到了该错误:OutOfMemoryError GC overhead limit exceeded 通过百度之后,知道该错误产生的原因是:jvm的垃圾回收期回收效率太低,并且多次触发gc之后,还是无法有效回收内 阅读全文
posted @ 2019-10-30 10:42 zhangxuezhi 阅读(470) 评论(0) 推荐(0) 编辑