eclipse搭建springboot2.0.2、mybatis、springmvc、log4j、devtools热部署基本搭建

结合上一篇所述,我们先搭建一个基本开发的框架示例

和之前一样创建一个springboot的项目



选中web、MyBatis、JDBC、MySQL选项Finish完成

在resources下创建generator文件夹和application.yml文件并删除原有的application.properties文件(这里我比较习惯用yml)

mybatis自动生成的xml的配置

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!DOCTYPE generatorConfiguration  
  3.         PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"  
  4.         "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">  
  5. <generatorConfiguration>  
  6.     <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->  
  7.     <classPathEntry  location="D:\cc_work\.m2\repository\mysql\mysql-connector-java\5.1.21\mysql-connector-java-5.1.21.jar"/>  
  8.     <context id="DB2Tables"  targetRuntime="MyBatis3">  
  9.         <commentGenerator>  
  10.             <property name="suppressDate" value="true"/>  
  11.             <!-- 是否去除自动生成的注释 true:是 : false:否 -->  
  12.             <property name="suppressAllComments" value="true"/>  
  13.         </commentGenerator>  
  14.         <!--数据库链接URL,用户名、密码 -->  
  15.         <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1/springboot" userId="root" password="">  
  16.         </jdbcConnection>  
  17.         <javaTypeResolver>  
  18.             <property name="forceBigDecimals" value="false"/>  
  19.         </javaTypeResolver>  
  20.         <!-- 生成模型的包名和位置-->  
  21.         <javaModelGenerator targetPackage="com.springboot.domain.model" targetProject="springboot-test/src/main/java">  
  22.             <property name="enableSubPackages" value="true"/>  
  23.             <property name="trimStrings" value="true"/>  
  24.         </javaModelGenerator>  
  25.         <!-- 生成映射文件的包名和位置-->  
  26.         <sqlMapGenerator targetPackage="mapping" targetProject="springboot-test/src/main/resources">  
  27.             <property name="enableSubPackages" value="true"/>  
  28.         </sqlMapGenerator>  
  29.         <!-- 生成DAO的包名和位置-->  
  30.         <javaClientGenerator type="XMLMAPPER" targetPackage="com.springboot.domain.mapper" targetProject="springboot-test/src/main/java">  
  31.             <property name="enableSubPackages" value="true"/>  
  32.         </javaClientGenerator>  
  33.         <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->  
  34.         <table tableName="wx_user" domainObjectName="WxUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">  
  35.             <property name="useActualColumnNames" value="true" />  
  36.         </table>  
  37.     </context>  
  38. </generatorConfiguration>  
application.yml的配置如下:

[html]  view plain  copy
  1. server:  
  2.   port: 80  
  3.   
  4. spring:  
  5.   mvc:  
  6.     view:  
  7.       prefix: /WEB-INF/jsp/  
  8.       suffix: .jsp  
  9.   datasource:  
  10.     url: jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=utf-8&useSSL=false  
  11.     username: root  
  12.     password:   
  13.     driver-class-name: com.mysql.jdbc.Driver  
  14.   
  15. mybatis:  
  16.   mapper-locations: classpath:mapping/*.xml  
  17.   type-aliases-package: com.springboot.domain.model  

执行完生成后我们接下来吧service和controller也写完。我们先看一下结构

在src/main/下面创建一个webapp WEB-INF jsp文件夹 和index.jsp文件


接下来我贴一下代码

controller

[java]  view plain  copy
  1. package com.springboot.controller;  
  2.   
  3. import java.util.List;  
  4.   
  5. import javax.annotation.Resource;  
  6.   
  7. import org.springframework.stereotype.Controller;  
  8. import org.springframework.web.bind.annotation.RequestMapping;  
  9. import org.springframework.web.bind.annotation.ResponseBody;  
  10.   
  11. import com.springboot.domain.model.WxUser;  
  12. import com.springboot.service.WxUserService;  
  13.   
  14. @Controller  
  15. @RequestMapping("wxuser")  
  16. public class TestController {  
  17.   
  18.     @Resource  
  19.     private WxUserService wxUserService;  
  20.       
  21.     @RequestMapping("index")  
  22.     public String index(){  
  23.           
  24.         return "index";  
  25.     }  
  26.       
  27.     @RequestMapping("getData")  
  28.     @ResponseBody  
  29.     public List<WxUser> getData(){  
  30.           
  31.         return wxUserService.selectWxUserList();  
  32.     }  
  33. }  

service接口就不贴了,直接实现

[java]  view plain  copy
  1. package com.springboot.service.impl;  
  2.   
  3. import java.util.List;  
  4.   
  5. import javax.annotation.Resource;  
  6.   
  7. import org.springframework.stereotype.Service;  
  8.   
  9. import com.springboot.domain.mapper.WxUserMapper;  
  10. import com.springboot.domain.model.WxUser;  
  11. import com.springboot.service.WxUserService;  
  12.   
  13. @Service  
  14. public class WxUserServiceImpl implements WxUserService{  
  15.   
  16.     @Resource  
  17.     private WxUserMapper wxUserMapper;  
  18.       
  19.     @Override  
  20.     public List<WxUser> selectWxUserList() {  
  21.         return wxUserMapper.selectWxUserList();  
  22.     }  
  23.   
  24. }  

dao接口

[java]  view plain  copy
  1. package com.springboot.domain.mapper;  
  2.   
  3. import java.util.List;  
  4.   
  5. import com.springboot.domain.model.WxUser;  
  6.   
  7. public interface WxUserMapper {  
  8.     int deleteByPrimaryKey(Integer id);  
  9.   
  10.     int insert(WxUser record);  
  11.   
  12.     int insertSelective(WxUser record);  
  13.   
  14.     WxUser selectByPrimaryKey(Integer id);  
  15.   
  16.     int updateByPrimaryKeySelective(WxUser record);  
  17.   
  18.     int updateByPrimaryKey(WxUser record);  
  19.       
  20.     List<WxUser> selectWxUserList();  
  21. }  

mapping映射文件

[java]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8" ?>  
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >  
  3. <mapper namespace="com.springboot.domain.mapper.WxUserMapper" >  
  4.   <resultMap id="BaseResultMap" type="com.springboot.domain.model.WxUser" >  
  5.     <id column="id" property="id" jdbcType="INTEGER" />  
  6.     <result column="nickname" property="nickname" jdbcType="VARCHAR" />  
  7.     <result column="openid" property="openid" jdbcType="VARCHAR" />  
  8.     <result column="subscribe" property="subscribe" jdbcType="VARCHAR" />  
  9.     <result column="sex" property="sex" jdbcType="VARCHAR" />  
  10.     <result column="city" property="city" jdbcType="VARCHAR" />  
  11.     <result column="country" property="country" jdbcType="VARCHAR" />  
  12.     <result column="province" property="province" jdbcType="VARCHAR" />  
  13.     <result column="language" property="language" jdbcType="VARCHAR" />  
  14.     <result column="headimgurl" property="headimgurl" jdbcType="VARCHAR" />  
  15.     <result column="subscribe_time" property="subscribe_time" jdbcType="INTEGER" />  
  16.     <result column="unionid" property="unionid" jdbcType="VARCHAR" />  
  17.     <result column="remark" property="remark" jdbcType="VARCHAR" />  
  18.     <result column="groupid" property="groupid" jdbcType="VARCHAR" />  
  19.     <result column="subscribe_scene" property="subscribe_scene" jdbcType="VARCHAR" />  
  20.     <result column="qr_scene" property="qr_scene" jdbcType="VARCHAR" />  
  21.     <result column="qr_scene_str" property="qr_scene_str" jdbcType="VARCHAR" />  
  22.   </resultMap>  
  23.   <sql id="Base_Column_List" >  
  24.     id, nickname, openid, subscribe, sex, city, country, province, language, headimgurl,   
  25.     subscribe_time, unionid, remark, groupid, subscribe_scene, qr_scene, qr_scene_str  
  26.   </sql>  
  27.   <!-- 这里是自己写的 -->  
  28.   <select id="selectWxUserList" resultMap="BaseResultMap" >  
  29.     select   
  30.     <include refid="Base_Column_List" />  
  31.     from wx_user  
  32.   </select>  
  33.   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >  
  34.     select   
  35.     <include refid="Base_Column_List" />  
  36.     from wx_user  
  37.     where id = #{id,jdbcType=INTEGER}  
  38.   </select>  
  39.   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >  
  40.     delete from wx_user  
  41.     where id = #{id,jdbcType=INTEGER}  
  42.   </delete>  
  43.   <insert id="insert" parameterType="com.springboot.domain.model.WxUser" >  
  44.     insert into wx_user (id, nickname, openid,   
  45.       subscribe, sex, city,   
  46.       country, province, language,   
  47.       headimgurl, subscribe_time, unionid,   
  48.       remark, groupid, subscribe_scene,   
  49.       qr_scene, qr_scene_str)  
  50.     values (#{id,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR},   
  51.       #{subscribe,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},   
  52.       #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR},   
  53.       #{headimgurl,jdbcType=VARCHAR}, #{subscribe_time,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR},   
  54.       #{remark,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{subscribe_scene,jdbcType=VARCHAR},   
  55.       #{qr_scene,jdbcType=VARCHAR}, #{qr_scene_str,jdbcType=VARCHAR})  
  56.   </insert>  
  57.   <insert id="insertSelective" parameterType="com.springboot.domain.model.WxUser" >  
  58.     insert into wx_user  
  59.     <trim prefix="(" suffix=")" suffixOverrides="," >  
  60.       <if test="id != null" >  
  61.         id,  
  62.       </if>  
  63.       <if test="nickname != null" >  
  64.         nickname,  
  65.       </if>  
  66.       <if test="openid != null" >  
  67.         openid,  
  68.       </if>  
  69.       <if test="subscribe != null" >  
  70.         subscribe,  
  71.       </if>  
  72.       <if test="sex != null" >  
  73.         sex,  
  74.       </if>  
  75.       <if test="city != null" >  
  76.         city,  
  77.       </if>  
  78.       <if test="country != null" >  
  79.         country,  
  80.       </if>  
  81.       <if test="province != null" >  
  82.         province,  
  83.       </if>  
  84.       <if test="language != null" >  
  85.         language,  
  86.       </if>  
  87.       <if test="headimgurl != null" >  
  88.         headimgurl,  
  89.       </if>  
  90.       <if test="subscribe_time != null" >  
  91.         subscribe_time,  
  92.       </if>  
  93.       <if test="unionid != null" >  
  94.         unionid,  
  95.       </if>  
  96.       <if test="remark != null" >  
  97.         remark,  
  98.       </if>  
  99.       <if test="groupid != null" >  
  100.         groupid,  
  101.       </if>  
  102.       <if test="subscribe_scene != null" >  
  103.         subscribe_scene,  
  104.       </if>  
  105.       <if test="qr_scene != null" >  
  106.         qr_scene,  
  107.       </if>  
  108.       <if test="qr_scene_str != null" >  
  109.         qr_scene_str,  
  110.       </if>  
  111.     </trim>  
  112.     <trim prefix="values (" suffix=")" suffixOverrides="," >  
  113.       <if test="id != null" >  
  114.         #{id,jdbcType=INTEGER},  
  115.       </if>  
  116.       <if test="nickname != null" >  
  117.         #{nickname,jdbcType=VARCHAR},  
  118.       </if>  
  119.       <if test="openid != null" >  
  120.         #{openid,jdbcType=VARCHAR},  
  121.       </if>  
  122.       <if test="subscribe != null" >  
  123.         #{subscribe,jdbcType=VARCHAR},  
  124.       </if>  
  125.       <if test="sex != null" >  
  126.         #{sex,jdbcType=VARCHAR},  
  127.       </if>  
  128.       <if test="city != null" >  
  129.         #{city,jdbcType=VARCHAR},  
  130.       </if>  
  131.       <if test="country != null" >  
  132.         #{country,jdbcType=VARCHAR},  
  133.       </if>  
  134.       <if test="province != null" >  
  135.         #{province,jdbcType=VARCHAR},  
  136.       </if>  
  137.       <if test="language != null" >  
  138.         #{language,jdbcType=VARCHAR},  
  139.       </if>  
  140.       <if test="headimgurl != null" >  
  141.         #{headimgurl,jdbcType=VARCHAR},  
  142.       </if>  
  143.       <if test="subscribe_time != null" >  
  144.         #{subscribe_time,jdbcType=INTEGER},  
  145.       </if>  
  146.       <if test="unionid != null" >  
  147.         #{unionid,jdbcType=VARCHAR},  
  148.       </if>  
  149.       <if test="remark != null" >  
  150.         #{remark,jdbcType=VARCHAR},  
  151.       </if>  
  152.       <if test="groupid != null" >  
  153.         #{groupid,jdbcType=VARCHAR},  
  154.       </if>  
  155.       <if test="subscribe_scene != null" >  
  156.         #{subscribe_scene,jdbcType=VARCHAR},  
  157.       </if>  
  158.       <if test="qr_scene != null" >  
  159.         #{qr_scene,jdbcType=VARCHAR},  
  160.       </if>  
  161.       <if test="qr_scene_str != null" >  
  162.         #{qr_scene_str,jdbcType=VARCHAR},  
  163.       </if>  
  164.     </trim>  
  165.   </insert>  
  166.   <update id="updateByPrimaryKeySelective" parameterType="com.springboot.domain.model.WxUser" >  
  167.     update wx_user  
  168.     <set >  
  169.       <if test="nickname != null" >  
  170.         nickname = #{nickname,jdbcType=VARCHAR},  
  171.       </if>  
  172.       <if test="openid != null" >  
  173.         openid = #{openid,jdbcType=VARCHAR},  
  174.       </if>  
  175.       <if test="subscribe != null" >  
  176.         subscribe = #{subscribe,jdbcType=VARCHAR},  
  177.       </if>  
  178.       <if test="sex != null" >  
  179.         sex = #{sex,jdbcType=VARCHAR},  
  180.       </if>  
  181.       <if test="city != null" >  
  182.         city = #{city,jdbcType=VARCHAR},  
  183.       </if>  
  184.       <if test="country != null" >  
  185.         country = #{country,jdbcType=VARCHAR},  
  186.       </if>  
  187.       <if test="province != null" >  
  188.         province = #{province,jdbcType=VARCHAR},  
  189.       </if>  
  190.       <if test="language != null" >  
  191.         language = #{language,jdbcType=VARCHAR},  
  192.       </if>  
  193.       <if test="headimgurl != null" >  
  194.         headimgurl = #{headimgurl,jdbcType=VARCHAR},  
  195.       </if>  
  196.       <if test="subscribe_time != null" >  
  197.         subscribe_time = #{subscribe_time,jdbcType=INTEGER},  
  198.       </if>  
  199.       <if test="unionid != null" >  
  200.         unionid = #{unionid,jdbcType=VARCHAR},  
  201.       </if>  
  202.       <if test="remark != null" >  
  203.         remark = #{remark,jdbcType=VARCHAR},  
  204.       </if>  
  205.       <if test="groupid != null" >  
  206.         groupid = #{groupid,jdbcType=VARCHAR},  
  207.       </if>  
  208.       <if test="subscribe_scene != null" >  
  209.         subscribe_scene = #{subscribe_scene,jdbcType=VARCHAR},  
  210.       </if>  
  211.       <if test="qr_scene != null" >  
  212.         qr_scene = #{qr_scene,jdbcType=VARCHAR},  
  213.       </if>  
  214.       <if test="qr_scene_str != null" >  
  215.         qr_scene_str = #{qr_scene_str,jdbcType=VARCHAR},  
  216.       </if>  
  217.     </set>  
  218.     where id = #{id,jdbcType=INTEGER}  
  219.   </update>  
  220.   <update id="updateByPrimaryKey" parameterType="com.springboot.domain.model.WxUser" >  
  221.     update wx_user  
  222.     set nickname = #{nickname,jdbcType=VARCHAR},  
  223.       openid = #{openid,jdbcType=VARCHAR},  
  224.       subscribe = #{subscribe,jdbcType=VARCHAR},  
  225.       sex = #{sex,jdbcType=VARCHAR},  
  226.       city = #{city,jdbcType=VARCHAR},  
  227.       country = #{country,jdbcType=VARCHAR},  
  228.       province = #{province,jdbcType=VARCHAR},  
  229.       language = #{language,jdbcType=VARCHAR},  
  230.       headimgurl = #{headimgurl,jdbcType=VARCHAR},  
  231.       subscribe_time = #{subscribe_time,jdbcType=INTEGER},  
  232.       unionid = #{unionid,jdbcType=VARCHAR},  
  233.       remark = #{remark,jdbcType=VARCHAR},  
  234.       groupid = #{groupid,jdbcType=VARCHAR},  
  235.       subscribe_scene = #{subscribe_scene,jdbcType=VARCHAR},  
  236.       qr_scene = #{qr_scene,jdbcType=VARCHAR},  
  237.       qr_scene_str = #{qr_scene_str,jdbcType=VARCHAR}  
  238.     where id = #{id,jdbcType=INTEGER}  
  239.   </update>  
  240. </mapper>  

然后我们在pom中需要加入jsp的依赖


在启动类上加入@MapperScan("com.springboot.domain.mapper")扫描

这里尤其要注意,SpringbootTestApplication这个类一定要在所有子包之上


接下来启动一下我们查看一下运行结果


我们访问一下网页



至此框架大体出现,接下来我们配置log4j,在pom文件中加入


[html]  view plain  copy
  1.         <dependency>  
  2.             <groupId>org.springframework.boot</groupId>  
  3.             <artifactId>spring-boot-starter</artifactId>  
  4.             <exclusions>  
  5.                 <exclusion>  
  6.                     <groupId>org.springframework.boot</groupId>  
  7.                     <artifactId>spring-boot-starter-logging</artifactId>  
  8.                 </exclusion>  
  9.             </exclusions>  
  10.         </dependency>  
  11.         <!-- log4j2 日志记录-->  
  12.         <dependency>  
  13.             <groupId>org.springframework.boot</groupId>  
  14.             <artifactId>spring-boot-starter-log4j2</artifactId>  
  15.         </dependency>  
  16.         <!-- 加上这个才能辨认到log4j2.yml文件 -->  
  17.         <dependency>  
  18.             <groupId>com.fasterxml.jackson.dataformat</groupId>  
  19.             <artifactId>jackson-dataformat-yaml</artifactId>  
  20.         </dependency>  

在resources中加入log4j2.yml

[html]  view plain  copy
  1. Configuration:  
  2.   status: DEBUG  
  3.   
  4.   Properties: # 定义全局变量  
  5.     Property: # 缺省配置(用于开发环境)。其他环境需要在VM参数中指定,如下:  
  6.     #测试:-Dlog.level.console=warn -Dlog.level.xjj=trace  
  7.     #生产:-Dlog.level.console=warn -Dlog.level.xjj=info  
  8.     - name: log.level.console  
  9.       value: trace  
  10.     - name: log.level.lee  
  11.       value: debug  
  12.     - name: log.path  
  13.       value: D://spring-boot//logs #log输出文件地址  
  14.     - name: project.name  
  15.       value: springboot-test       #log文件名字  
  16.   
  17.   Appenders:  
  18.     Console: #输出到控制台  
  19.       name: CONSOLE  
  20.       target: SYSTEM_OUT  
  21.       ThresholdFilter:  
  22.         level:  ${sys:log.level.console} # “sys:”表示:如果VM参数中没指定这个变量值,则使用本文件中定义的缺省全局变量值  
  23.         onMatch: ACCEPT  
  24.         onMismatch: DENY  
  25.       PatternLayout:  
  26.         #pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"  
  27.         pattern: "%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}"  
  28.     RollingFile:  
  29.     - name: ROLLING_FILE  
  30.       ignoreExceptions: false  
  31.       fileName: ${log.path}/${project.name}.log  
  32.       filePattern: "${log.path}/$${date:yyyy-MM}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz"  
  33.       PatternLayout:  
  34.         pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"  
  35.       Policies:  
  36.         SizeBasedTriggeringPolicy:  
  37.            size: "128 MB"  
  38.       DefaultRolloverStrategy:  
  39.          max: 1000  
  40.   
  41.   Loggers:  
  42.     Root:  
  43.       level: info  
  44.       AppenderRef:  
  45.         - ref: CONSOLE  
  46.         - ref: ROLLING_FILE  
  47.       Logger: # 为com.lee包配置特殊的Log级别,方便调试  
  48.         - name: com.springboot  
  49.           additivity: false  
  50.           level: ${sys:log.level.lee}  
  51.           AppenderRef:  
  52.             - ref: CONSOLE  
  53.             - ref: ROLLING_FILE  

启动输出:

[html]  view plain  copy
  1. 2018-05-29 15:42:57,712 main DEBUG Initializing configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]  
  2. 2018-05-29 15:42:57,719 main DEBUG Installed 1 script engine  
  3. 2018-05-29 15:42:58,046 main DEBUG Oracle Nashorn version: 1.8.0_152, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory  
  4. 2018-05-29 15:42:58,047 main DEBUG PluginManager 'Core' found 116 plugins  
  5. 2018-05-29 15:42:58,047 main DEBUG PluginManager 'Level' found 0 plugins  
  6. 2018-05-29 15:42:58,047 main DEBUG Processing node for object Properties  
  7. 2018-05-29 15:42:58,047 main DEBUG Processing node for array Property  
  8. 2018-05-29 15:42:58,047 main DEBUG Processing Property[0]  
  9. 2018-05-29 15:42:58,048 main DEBUG Processing Property[1]  
  10. 2018-05-29 15:42:58,048 main DEBUG Processing Property[2]  
  11. 2018-05-29 15:42:58,048 main DEBUG Processing Property[3]  
  12. 2018-05-29 15:42:58,048 main DEBUG Returning Properties with parent root of type properties:class org.apache.logging.log4j.core.config.PropertiesPlugin  
  13. 2018-05-29 15:42:58,048 main DEBUG Processing node for object Appenders  
  14. 2018-05-29 15:42:58,049 main DEBUG Processing node for object Console  
  15. 2018-05-29 15:42:58,049 main DEBUG Node name is of type STRING  
  16. 2018-05-29 15:42:58,049 main DEBUG Node target is of type STRING  
  17. 2018-05-29 15:42:58,049 main DEBUG Processing node for object ThresholdFilter  
  18. 2018-05-29 15:42:58,051 main DEBUG Node level is of type STRING  
  19. 2018-05-29 15:42:58,051 main DEBUG Node onMatch is of type STRING  
  20. 2018-05-29 15:42:58,051 main DEBUG Node onMismatch is of type STRING  
  21. 2018-05-29 15:42:58,052 main DEBUG Returning ThresholdFilter with parent Console of type filter:class org.apache.logging.log4j.core.filter.ThresholdFilter  
  22. 2018-05-29 15:42:58,052 main DEBUG Processing node for object PatternLayout  
  23. 2018-05-29 15:42:58,052 main DEBUG Node pattern is of type STRING  
  24. 2018-05-29 15:42:58,052 main DEBUG Returning PatternLayout with parent Console of type layout:class org.apache.logging.log4j.core.layout.PatternLayout  
  25. 2018-05-29 15:42:58,053 main DEBUG Returning Console with parent Appenders of type appender:class org.apache.logging.log4j.core.appender.ConsoleAppender  
  26. 2018-05-29 15:42:58,053 main DEBUG Processing node for array RollingFile  
  27. 2018-05-29 15:42:58,053 main DEBUG Processing RollingFile[0]  
  28. 2018-05-29 15:42:58,053 main DEBUG Processing node for object PatternLayout  
  29. 2018-05-29 15:42:58,053 main DEBUG Node pattern is of type STRING  
  30. 2018-05-29 15:42:58,054 main DEBUG Returning PatternLayout with parent RollingFile of type layout:class org.apache.logging.log4j.core.layout.PatternLayout  
  31. 2018-05-29 15:42:58,054 main DEBUG Processing node for object Policies  
  32. 2018-05-29 15:42:58,054 main DEBUG Processing node for object SizeBasedTriggeringPolicy  
  33. 2018-05-29 15:42:58,054 main DEBUG Node size is of type STRING  
  34. 2018-05-29 15:42:58,055 main DEBUG Returning SizeBasedTriggeringPolicy with parent Policies of type SizeBasedTriggeringPolicy:class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy  
  35. 2018-05-29 15:42:58,055 main DEBUG Returning Policies with parent RollingFile of type Policies:class org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy  
  36. 2018-05-29 15:42:58,056 main DEBUG Processing node for object DefaultRolloverStrategy  
  37. 2018-05-29 15:42:58,060 main DEBUG Node max is of type NUMBER  
  38. 2018-05-29 15:42:58,060 main DEBUG Returning DefaultRolloverStrategy with parent RollingFile of type DefaultRolloverStrategy:class org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy  
  39. 2018-05-29 15:42:58,061 main DEBUG Returning Appenders with parent root of type appenders:class org.apache.logging.log4j.core.config.AppendersPlugin  
  40. 2018-05-29 15:42:58,061 main DEBUG Processing node for object Loggers  
  41. 2018-05-29 15:42:58,061 main DEBUG Processing node for object Root  
  42. 2018-05-29 15:42:58,061 main DEBUG Node level is of type STRING  
  43. 2018-05-29 15:42:58,062 main DEBUG Processing node for array AppenderRef  
  44. 2018-05-29 15:42:58,062 main DEBUG Processing AppenderRef[0]  
  45. 2018-05-29 15:42:58,062 main DEBUG Processing AppenderRef[1]  
  46. 2018-05-29 15:42:58,062 main DEBUG Processing node for array Logger  
  47. 2018-05-29 15:42:58,062 main DEBUG Processing Logger[0]  
  48. 2018-05-29 15:42:58,063 main DEBUG Processing array for object AppenderRef  
  49. 2018-05-29 15:42:58,063 main DEBUG Node ref is of type STRING  
  50. 2018-05-29 15:42:58,063 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef  
  51. 2018-05-29 15:42:58,064 main DEBUG Node ref is of type STRING  
  52. 2018-05-29 15:42:58,064 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef  
  53. 2018-05-29 15:42:58,064 main DEBUG Returning Root with parent Loggers of type root:class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger  
  54. 2018-05-29 15:42:58,064 main DEBUG Returning Loggers with parent root of type loggers:class org.apache.logging.log4j.core.config.LoggersPlugin  
  55. 2018-05-29 15:42:58,065 main DEBUG Completed parsing configuration  
  56. 2018-05-29 15:42:58,070 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  57. 2018-05-29 15:42:58,087 main DEBUG PluginManager 'TypeConverter' found 26 plugins  
  58. 2018-05-29 15:42:58,097 main DEBUG createProperty(name="log.level.console"value="trace")  
  59. 2018-05-29 15:42:58,097 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  60. 2018-05-29 15:42:58,098 main DEBUG createProperty(name="log.level.lee"value="debug")  
  61. 2018-05-29 15:42:58,099 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  62. 2018-05-29 15:42:58,099 main DEBUG createProperty(name="log.path"value="D://spring-boot//logs")  
  63. 2018-05-29 15:42:58,099 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  64. 2018-05-29 15:42:58,100 main DEBUG createProperty(name="project.name"value="springboot-test")  
  65. 2018-05-29 15:42:58,100 main DEBUG Building Plugin[name=propertiesclass=org.apache.logging.log4j.core.config.PropertiesPlugin].  
  66. 2018-05-29 15:42:58,115 main DEBUG configureSubstitutor(={log.level.console=tracelog.level.lee=debuglog.path=D://spring-boot//logs, project.name=springboot-test}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))  
  67. 2018-05-29 15:42:58,116 main DEBUG PluginManager 'Lookup' found 13 plugins  
  68. 2018-05-29 15:42:58,117 main DEBUG Building Plugin[name=filterclass=org.apache.logging.log4j.core.filter.ThresholdFilter].  
  69. 2018-05-29 15:42:58,122 main DEBUG createFilter(level="TRACE"onMatch="ACCEPT"onMismatch="DENY")  
  70. 2018-05-29 15:42:58,123 main DEBUG Building Plugin[name=layoutclass=org.apache.logging.log4j.core.layout.PatternLayout].  
  71. 2018-05-29 15:42:58,129 main DEBUG PatternLayout$Builder(pattern="%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}"PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=nullcharset="null"alwaysWriteExceptions="null"disableAnsi="null"noConsoleNoAnsi="null"header="null"footer="null")  
  72. 2018-05-29 15:42:58,130 main DEBUG PluginManager 'Converter' found 45 plugins  
  73. 2018-05-29 15:42:58,158 main DEBUG Building Plugin[name=appenderclass=org.apache.logging.log4j.core.appender.ConsoleAppender].  
  74. 2018-05-29 15:42:58,165 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT"follow="null"direct="null"bufferedIo="null"bufferSize="null"immediateFlush="null"ignoreExceptions="null", PatternLayout(%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}), name="CONSOLE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), ThresholdFilter(TRACE))  
  75. 2018-05-29 15:42:58,167 main DEBUG Starting OutputStreamManager SYSTEM_OUT.false.false  
  76. 2018-05-29 15:42:58,167 main DEBUG Building Plugin[name=layoutclass=org.apache.logging.log4j.core.layout.PatternLayout].  
  77. 2018-05-29 15:42:58,168 main DEBUG PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=nullcharset="null"alwaysWriteExceptions="null"disableAnsi="null"noConsoleNoAnsi="null"header="null"footer="null")  
  78. 2018-05-29 15:42:58,169 main DEBUG Building Plugin[name=SizeBasedTriggeringPolicyclass=org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy].  
  79. 2018-05-29 15:42:58,171 main DEBUG createPolicy(size="128 MB")  
  80. 2018-05-29 15:42:58,172 main DEBUG Building Plugin[name=Policiesclass=org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy].  
  81. 2018-05-29 15:42:58,174 main DEBUG createPolicy(={SizeBasedTriggeringPolicy(size=134217728)})  
  82. 2018-05-29 15:42:58,175 main DEBUG Building Plugin[name=DefaultRolloverStrategyclass=org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy].  
  83. 2018-05-29 15:42:58,178 main DEBUG DefaultRolloverStrategy$Builder(max="1000"min="null"fileIndex="null"compressionLevel="null", ={}, stopCustomActionsOnError="null"tempCompressedFilePattern="null", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))  
  84. 2018-05-29 15:42:58,179 main DEBUG Building Plugin[name=appenderclass=org.apache.logging.log4j.core.appender.RollingFileAppender].  
  85. 2018-05-29 15:42:58,181 main DEBUG RollingFileAppender$Builder(fileName="D://spring-boot//logs/springboot-test.log"filePattern="D://spring-boot//logs/${date:yyyy-MM}/springboot-test-%d{yyyy-MM-dd}-%i.log.gz"append="null"locking="null", Policies(CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])), DefaultRolloverStrategy(DefaultRolloverStrategy(min=1max=1000useMax=true)), advertise="null"advertiseUri="null"createOnDemand="null"filePermissions="null"fileOwner="null"fileGroup="null"bufferedIo="null"bufferSize="null"immediateFlush="null"ignoreExceptions="false", PatternLayout(%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n), name="ROLLING_FILE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  86. 2018-05-29 15:42:58,186 main DEBUG Starting RollingFileManager D://spring-boot//logs/springboot-test.log  
  87. 2018-05-29 15:42:58,188 main DEBUG PluginManager 'FileConverter' found 2 plugins  
  88. 2018-05-29 15:42:58,189 main DEBUG Setting prev file time to 2018-05-29T15:42:58.186+0800  
  89. 2018-05-29 15:42:58,191 main DEBUG Initializing triggering policy CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])  
  90. 2018-05-29 15:42:58,191 main DEBUG Building Plugin[name=appendersclass=org.apache.logging.log4j.core.config.AppendersPlugin].  
  91. 2018-05-29 15:42:58,192 main DEBUG createAppenders(={CONSOLE, ROLLING_FILE})  
  92. 2018-05-29 15:42:58,192 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  93. 2018-05-29 15:42:58,193 main DEBUG createAppenderRef(ref="CONSOLE"level="null"Filter=null)  
  94. 2018-05-29 15:42:58,193 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  95. 2018-05-29 15:42:58,194 main DEBUG createAppenderRef(ref="ROLLING_FILE"level="null"Filter=null)  
  96. 2018-05-29 15:42:58,194 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  97. 2018-05-29 15:42:58,194 main DEBUG createAppenderRef(ref="CONSOLE"level="null"Filter=null)  
  98. 2018-05-29 15:42:58,195 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  99. 2018-05-29 15:42:58,196 main DEBUG createAppenderRef(ref="ROLLING_FILE"level="null"Filter=null)  
  100. 2018-05-29 15:42:58,196 main DEBUG Building Plugin[name=loggerclass=org.apache.logging.log4j.core.config.LoggerConfig].  
  101. 2018-05-29 15:42:58,207 main DEBUG createLogger(additivity="false"level="DEBUG"name="com.springboot"includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  102. 2018-05-29 15:42:58,209 main DEBUG Building Plugin[name=rootclass=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].  
  103. 2018-05-29 15:42:58,210 main ERROR root Root has no parameter that matches element Logger  
  104. 2018-05-29 15:42:58,210 main DEBUG createLogger(additivity="null"level="INFO"includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  105. 2018-05-29 15:42:58,211 main DEBUG Building Plugin[name=loggersclass=org.apache.logging.log4j.core.config.LoggersPlugin].  
  106. 2018-05-29 15:42:58,211 main DEBUG createLoggers(={root})  
  107. 2018-05-29 15:42:58,212 main DEBUG Configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] initialized  
  108. 2018-05-29 15:42:58,212 main DEBUG Starting configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]  
  109. 2018-05-29 15:42:58,212 main DEBUG Started configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK.  
  110. 2018-05-29 15:42:58,213 main DEBUG Shutting down OutputStreamManager SYSTEM_OUT.false.false-1  
  111. 2018-05-29 15:42:58,213 main DEBUG Shut down OutputStreamManager SYSTEM_OUT.false.false-1, all resources released: true  
  112. 2018-05-29 15:42:58,214 main DEBUG Appender DefaultConsole-1 stopped with status true  
  113. 2018-05-29 15:42:58,214 main DEBUG Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@2f7a2457 OK  
  114. 2018-05-29 15:42:58,219 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6  
  115. 2018-05-29 15:42:58,221 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=StatusLogger  
  116. 2018-05-29 15:42:58,223 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=ContextSelector  
  117. 2018-05-29 15:42:58,225 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Loggers,name=  
  118. 2018-05-29 15:42:58,227 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=CONSOLE  
  119. 2018-05-29 15:42:58,228 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=ROLLING_FILE  
  120. 2018-05-29 15:42:58,231 main DEBUG Reconfiguration complete for context[name=764c12b6] at URI D:\cc_work\demo\springboot-test\target\classes\log4j2.yml (org.apache.logging.log4j.core.LoggerContext@2584b82d) with optional ClassLoader: null  
  121. 2018-05-29 15:42:58,231 main DEBUG Shutdown hook enabled. Registering a new one.  
  122. 2018-05-29 15:42:58,233 main DEBUG LoggerContext[name=764c12b6, org.apache.logging.log4j.core.LoggerContext@2584b82d] started OK.  
  123. 2018-05-29 15:42:58,540 main DEBUG Reconfiguration started for context[name=764c12b6] at URI null (org.apache.logging.log4j.core.LoggerContext@2584b82d) with optional ClassLoader: null  
  124. 2018-05-29 15:42:58,541 main DEBUG Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@7803bfd  
  125. 2018-05-29 15:42:58,546 main INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.  
  126. 2018-05-29 15:42:58,552 main DEBUG Initializing configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]  
  127. 2018-05-29 15:42:58,553 main DEBUG Installed 1 script engine  
  128. 2018-05-29 15:42:58,565 main DEBUG Oracle Nashorn version: 1.8.0_152, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory  
  129. 2018-05-29 15:42:58,566 main DEBUG PluginManager 'Core' found 116 plugins  
  130. 2018-05-29 15:42:58,566 main DEBUG PluginManager 'Level' found 0 plugins  
  131. 2018-05-29 15:42:58,566 main DEBUG Processing node for object Properties  
  132. 2018-05-29 15:42:58,566 main DEBUG Processing node for array Property  
  133. 2018-05-29 15:42:58,567 main DEBUG Processing Property[0]  
  134. 2018-05-29 15:42:58,567 main DEBUG Processing Property[1]  
  135. 2018-05-29 15:42:58,567 main DEBUG Processing Property[2]  
  136. 2018-05-29 15:42:58,567 main DEBUG Processing Property[3]  
  137. 2018-05-29 15:42:58,567 main DEBUG Returning Properties with parent root of type properties:class org.apache.logging.log4j.core.config.PropertiesPlugin  
  138. 2018-05-29 15:42:58,568 main DEBUG Processing node for object Appenders  
  139. 2018-05-29 15:42:58,568 main DEBUG Processing node for object Console  
  140. 2018-05-29 15:42:58,568 main DEBUG Node name is of type STRING  
  141. 2018-05-29 15:42:58,568 main DEBUG Node target is of type STRING  
  142. 2018-05-29 15:42:58,569 main DEBUG Processing node for object ThresholdFilter  
  143. 2018-05-29 15:42:58,569 main DEBUG Node level is of type STRING  
  144. 2018-05-29 15:42:58,569 main DEBUG Node onMatch is of type STRING  
  145. 2018-05-29 15:42:58,569 main DEBUG Node onMismatch is of type STRING  
  146. 2018-05-29 15:42:58,569 main DEBUG Returning ThresholdFilter with parent Console of type filter:class org.apache.logging.log4j.core.filter.ThresholdFilter  
  147. 2018-05-29 15:42:58,570 main DEBUG Processing node for object PatternLayout  
  148. 2018-05-29 15:42:58,570 main DEBUG Node pattern is of type STRING  
  149. 2018-05-29 15:42:58,570 main DEBUG Returning PatternLayout with parent Console of type layout:class org.apache.logging.log4j.core.layout.PatternLayout  
  150. 2018-05-29 15:42:58,570 main DEBUG Returning Console with parent Appenders of type appender:class org.apache.logging.log4j.core.appender.ConsoleAppender  
  151. 2018-05-29 15:42:58,570 main DEBUG Processing node for array RollingFile  
  152. 2018-05-29 15:42:58,571 main DEBUG Processing RollingFile[0]  
  153. 2018-05-29 15:42:58,571 main DEBUG Processing node for object PatternLayout  
  154. 2018-05-29 15:42:58,571 main DEBUG Node pattern is of type STRING  
  155. 2018-05-29 15:42:58,571 main DEBUG Returning PatternLayout with parent RollingFile of type layout:class org.apache.logging.log4j.core.layout.PatternLayout  
  156. 2018-05-29 15:42:58,571 main DEBUG Processing node for object Policies  
  157. 2018-05-29 15:42:58,572 main DEBUG Processing node for object SizeBasedTriggeringPolicy  
  158. 2018-05-29 15:42:58,572 main DEBUG Node size is of type STRING  
  159. 2018-05-29 15:42:58,572 main DEBUG Returning SizeBasedTriggeringPolicy with parent Policies of type SizeBasedTriggeringPolicy:class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy  
  160. 2018-05-29 15:42:58,572 main DEBUG Returning Policies with parent RollingFile of type Policies:class org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy  
  161. 2018-05-29 15:42:58,572 main DEBUG Processing node for object DefaultRolloverStrategy  
  162. 2018-05-29 15:42:58,573 main DEBUG Node max is of type NUMBER  
  163. 2018-05-29 15:42:58,573 main DEBUG Returning DefaultRolloverStrategy with parent RollingFile of type DefaultRolloverStrategy:class org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy  
  164. 2018-05-29 15:42:58,573 main DEBUG Returning Appenders with parent root of type appenders:class org.apache.logging.log4j.core.config.AppendersPlugin  
  165. 2018-05-29 15:42:58,573 main DEBUG Processing node for object Loggers  
  166. 2018-05-29 15:42:58,574 main DEBUG Processing node for object Root  
  167. 2018-05-29 15:42:58,574 main DEBUG Node level is of type STRING  
  168. 2018-05-29 15:42:58,574 main DEBUG Processing node for array AppenderRef  
  169. 2018-05-29 15:42:58,574 main DEBUG Processing AppenderRef[0]  
  170. 2018-05-29 15:42:58,574 main DEBUG Processing AppenderRef[1]  
  171. 2018-05-29 15:42:58,575 main DEBUG Processing node for array Logger  
  172. 2018-05-29 15:42:58,575 main DEBUG Processing Logger[0]  
  173. 2018-05-29 15:42:58,575 main DEBUG Processing array for object AppenderRef  
  174. 2018-05-29 15:42:58,575 main DEBUG Node ref is of type STRING  
  175. 2018-05-29 15:42:58,576 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef  
  176. 2018-05-29 15:42:58,599 main DEBUG Node ref is of type STRING  
  177. 2018-05-29 15:42:58,599 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef  
  178. 2018-05-29 15:42:58,599 main DEBUG Returning Root with parent Loggers of type root:class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger  
  179. 2018-05-29 15:42:58,600 main DEBUG Returning Loggers with parent root of type loggers:class org.apache.logging.log4j.core.config.LoggersPlugin  
  180. 2018-05-29 15:42:58,600 main DEBUG Completed parsing configuration  
  181. 2018-05-29 15:42:58,600 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  182. 2018-05-29 15:42:58,601 main DEBUG createProperty(name="log.level.console"value="trace")  
  183. 2018-05-29 15:42:58,601 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  184. 2018-05-29 15:42:58,601 main DEBUG createProperty(name="log.level.lee"value="debug")  
  185. 2018-05-29 15:42:58,601 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  186. 2018-05-29 15:42:58,602 main DEBUG createProperty(name="log.path"value="D://spring-boot//logs")  
  187. 2018-05-29 15:42:58,602 main DEBUG Building Plugin[name=propertyclass=org.apache.logging.log4j.core.config.Property].  
  188. 2018-05-29 15:42:58,602 main DEBUG createProperty(name="project.name"value="springboot-test")  
  189. 2018-05-29 15:42:58,603 main DEBUG Building Plugin[name=propertiesclass=org.apache.logging.log4j.core.config.PropertiesPlugin].  
  190. 2018-05-29 15:42:58,604 main DEBUG configureSubstitutor(={log.level.console=tracelog.level.lee=debuglog.path=D://spring-boot//logs, project.name=springboot-test}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))  
  191. 2018-05-29 15:42:58,605 main DEBUG PluginManager 'Lookup' found 13 plugins  
  192. 2018-05-29 15:42:58,606 main DEBUG Building Plugin[name=filterclass=org.apache.logging.log4j.core.filter.ThresholdFilter].  
  193. 2018-05-29 15:42:58,606 main DEBUG createFilter(level="TRACE"onMatch="ACCEPT"onMismatch="DENY")  
  194. 2018-05-29 15:42:58,606 main DEBUG Building Plugin[name=layoutclass=org.apache.logging.log4j.core.layout.PatternLayout].  
  195. 2018-05-29 15:42:58,607 main DEBUG PatternLayout$Builder(pattern="%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}"PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=nullcharset="null"alwaysWriteExceptions="null"disableAnsi="null"noConsoleNoAnsi="null"header="null"footer="null")  
  196. 2018-05-29 15:42:58,607 main DEBUG PluginManager 'Converter' found 45 plugins  
  197. 2018-05-29 15:42:58,610 main DEBUG Building Plugin[name=appenderclass=org.apache.logging.log4j.core.appender.ConsoleAppender].  
  198. 2018-05-29 15:42:58,611 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT"follow="null"direct="null"bufferedIo="null"bufferSize="null"immediateFlush="null"ignoreExceptions="null", PatternLayout(%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}), name="CONSOLE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), ThresholdFilter(TRACE))  
  199. 2018-05-29 15:42:58,613 main DEBUG Building Plugin[name=layoutclass=org.apache.logging.log4j.core.layout.PatternLayout].  
  200. 2018-05-29 15:42:58,613 main DEBUG PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=nullcharset="null"alwaysWriteExceptions="null"disableAnsi="null"noConsoleNoAnsi="null"header="null"footer="null")  
  201. 2018-05-29 15:42:58,614 main DEBUG Building Plugin[name=SizeBasedTriggeringPolicyclass=org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy].  
  202. 2018-05-29 15:42:58,614 main DEBUG createPolicy(size="128 MB")  
  203. 2018-05-29 15:42:58,615 main DEBUG Building Plugin[name=Policiesclass=org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy].  
  204. 2018-05-29 15:42:58,615 main DEBUG createPolicy(={SizeBasedTriggeringPolicy(size=134217728)})  
  205. 2018-05-29 15:42:58,615 main DEBUG Building Plugin[name=DefaultRolloverStrategyclass=org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy].  
  206. 2018-05-29 15:42:58,616 main DEBUG DefaultRolloverStrategy$Builder(max="1000"min="null"fileIndex="null"compressionLevel="null", ={}, stopCustomActionsOnError="null"tempCompressedFilePattern="null", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))  
  207. 2018-05-29 15:42:58,616 main DEBUG Building Plugin[name=appenderclass=org.apache.logging.log4j.core.appender.RollingFileAppender].  
  208. 2018-05-29 15:42:58,616 main DEBUG RollingFileAppender$Builder(fileName="D://spring-boot//logs/springboot-test.log"filePattern="D://spring-boot//logs/${date:yyyy-MM}/springboot-test-%d{yyyy-MM-dd}-%i.log.gz"append="null"locking="null", Policies(CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])), DefaultRolloverStrategy(DefaultRolloverStrategy(min=1max=1000useMax=true)), advertise="null"advertiseUri="null"createOnDemand="null"filePermissions="null"fileOwner="null"fileGroup="null"bufferedIo="null"bufferSize="null"immediateFlush="null"ignoreExceptions="false", PatternLayout(%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n), name="ROLLING_FILE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  209. 2018-05-29 15:42:58,617 main DEBUG PluginManager 'FileConverter' found 2 plugins  
  210. 2018-05-29 15:42:58,617 main DEBUG Building Plugin[name=appendersclass=org.apache.logging.log4j.core.config.AppendersPlugin].  
  211. 2018-05-29 15:42:58,617 main DEBUG createAppenders(={CONSOLE, ROLLING_FILE})  
  212. 2018-05-29 15:42:58,618 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  213. 2018-05-29 15:42:58,631 main DEBUG createAppenderRef(ref="CONSOLE"level="null"Filter=null)  
  214. 2018-05-29 15:42:58,632 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  215. 2018-05-29 15:42:58,632 main DEBUG createAppenderRef(ref="ROLLING_FILE"level="null"Filter=null)  
  216. 2018-05-29 15:42:58,632 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  217. 2018-05-29 15:42:58,633 main DEBUG createAppenderRef(ref="CONSOLE"level="null"Filter=null)  
  218. 2018-05-29 15:42:58,633 main DEBUG Building Plugin[name=AppenderRefclass=org.apache.logging.log4j.core.config.AppenderRef].  
  219. 2018-05-29 15:42:58,633 main DEBUG createAppenderRef(ref="ROLLING_FILE"level="null"Filter=null)  
  220. 2018-05-29 15:42:58,633 main DEBUG Building Plugin[name=loggerclass=org.apache.logging.log4j.core.config.LoggerConfig].  
  221. 2018-05-29 15:42:58,634 main DEBUG createLogger(additivity="false"level="DEBUG"name="com.springboot"includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  222. 2018-05-29 15:42:58,634 main DEBUG Building Plugin[name=rootclass=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].  
  223. 2018-05-29 15:42:58,636 main ERROR root Root has no parameter that matches element Logger  
  224. 2018-05-29 15:42:58,636 main DEBUG createLogger(additivity="null"level="INFO"includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)  
  225. 2018-05-29 15:42:58,637 main DEBUG Building Plugin[name=loggersclass=org.apache.logging.log4j.core.config.LoggersPlugin].  
  226. 2018-05-29 15:42:58,637 main DEBUG createLoggers(={root})  
  227. 2018-05-29 15:42:58,637 main DEBUG Configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] initialized  
  228. 2018-05-29 15:42:58,637 main DEBUG Starting configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]  
  229. 2018-05-29 15:42:58,638 main DEBUG Started configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK.  
  230. 2018-05-29 15:42:58,639 main DEBUG Appender ROLLING_FILE stopped with status true  
  231. 2018-05-29 15:42:58,639 main DEBUG Appender CONSOLE stopped with status true  
  232. 2018-05-29 15:42:58,640 main DEBUG Stopped YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK  
  233. 2018-05-29 15:42:58,641 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6  
  234. 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=StatusLogger  
  235. 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=ContextSelector  
  236. 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Loggers,name=  
  237. 2018-05-29 15:42:58,643 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=CONSOLE  
  238. 2018-05-29 15:42:58,643 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=ROLLING_FILE  
  239. 2018-05-29 15:42:58,643 main DEBUG Reconfiguration complete for context[name=764c12b6] at URI D:\cc_work\demo\springboot-test\target\classes\log4j2.yml (org.apache.logging.log4j.core.LoggerContext@2584b82d) with optional ClassLoader: null  
  240.   
  241.   .   ____          _            __ _ _  
  242.  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \  
  243. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \  
  244.  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )  
  245.   '  |____| .__|_| |_|_| |_\__, | / / / /  
  246.  =========|_|==============|___/=/_/_/_/  
  247.  :: Spring Boot ::        (v2.0.2.RELEASE)  
  248.   
  249. 2018-05-29 15:42:58,787:INFO main (StartupInfoLogger.java:50) - Starting SpringbootTestApplication on CC-PC with PID 22252 (D:\cc_work\demo\springboot-test\target\classes started by xiamonian in D:\cc_work\demo\springboot-test)  
  250. 2018-05-29 15:42:58,790 main DEBUG AsyncLogger.ThreadNameStrategy=UNCACHED (user specified null, default is UNCACHED)  
  251. 2018-05-29 15:42:58,792:INFO main (SpringApplication.java:659) - No active profile set, falling back to default profiles: default  
  252. 2018-05-29 15:42:58,886:INFO main (AbstractApplicationContext.java:590) - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@63798ca7: startup date [Tue May 29 15:42:58 CST 2018]; root of context hierarchy  
  253. 2018-05-29 15:43:00,743:INFO main (TomcatWebServer.java:91) - Tomcat initialized with port(s): 80 (http)  
  254. 2018-05-29 15:43:00,763:INFO main (DirectJDKLog.java:180) - Initializing ProtocolHandler ["http-nio-80"]  
  255. 2018-05-29 15:43:00,779:INFO main (DirectJDKLog.java:180) - Starting service [Tomcat]  
  256. 2018-05-29 15:43:00,780:INFO main (DirectJDKLog.java:180) - Starting Servlet Engine: Apache Tomcat/8.5.31  
  257. 2018-05-29 15:43:00,793:INFO localhost-startStop-1 (DirectJDKLog.java:180) - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_152\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_152/bin/server;C:/Program Files/Java/jre1.8.0_152/bin;C:/Program Files/Java/jre1.8.0_152/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Java\jdk1.8.0_152\jre\bin;D:\cc_work\apache-maven-3.1.1\bin\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%MYSQL_HOME%\bin;C:\Users\xiamonian\AppData\Local\Microsoft\WindowsApps;C:\Users\xiamonian\AppData\Roaming\npm;;D:\cc_work\eclipse;;.]  
  258. 2018-05-29 15:43:01,008:INFO localhost-startStop-1 (DirectJDKLog.java:180) - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
  259. 2018-05-29 15:43:01,020:INFO localhost-startStop-1 (DirectJDKLog.java:180) - Initializing Spring embedded WebApplicationContext  
  260. 2018-05-29 15:43:01,021:INFO localhost-startStop-1 (ServletWebServerApplicationContext.java:285) - Root WebApplicationContext: initialization completed in 2138 ms  
  261. 2018-05-29 15:43:01,288:INFO localhost-startStop-1 (ServletRegistrationBean.java:185) - Servlet dispatcherServlet mapped to [/]  
  262. 2018-05-29 15:43:01,295:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'characterEncodingFilter' to: [/*]  
  263. 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]  
  264. 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'httpPutFormContentFilter' to: [/*]  
  265. 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'requestContextFilter' to: [/*]  
  266. 2018-05-29 15:43:01,889:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]  
  267. 2018-05-29 15:43:02,147:INFO main (RequestMappingHandlerAdapter.java:574) - Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@63798ca7: startup date [Tue May 29 15:42:58 CST 2018]; root of context hierarchy  
  268. 2018-05-29 15:43:02,253:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/wxuser/index]}" onto public java.lang.String com.springboot.controller.TestController.index()  
  269. 2018-05-29 15:43:02,254:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/wxuser/getData]}" onto public java.util.List<com.springboot.domain.model.WxUser> com.springboot.controller.TestController.getData()  
  270. 2018-05-29 15:43:02,257:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)  
  271. 2018-05-29 15:43:02,258:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)  
  272. 2018-05-29 15:43:02,308:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]  
  273. 2018-05-29 15:43:02,308:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]  
  274. 2018-05-29 15:43:02,385:INFO main (WelcomePageHandlerMapping.java:61) - Adding welcome page template: index  
  275. 2018-05-29 15:43:02,711:INFO main (MBeanExporter.java:433) - Registering beans for JMX exposure on startup  
  276. 2018-05-29 15:43:02,713:INFO main (MBeanExporter.java:895) - Bean with name 'dataSource' has been autodetected for JMX exposure  
  277. 2018-05-29 15:43:02,720:INFO main (MBeanExporter.java:668) - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]  
  278. 2018-05-29 15:43:02,729:INFO main (DirectJDKLog.java:180) - Starting ProtocolHandler ["http-nio-80"]  
  279. 2018-05-29 15:43:02,744:INFO main (DirectJDKLog.java:180) - Using a shared selector for servlet write/read  
  280. 2018-05-29 15:43:02,782:INFO main (TomcatWebServer.java:206) - Tomcat started on port(s): 80 (http) with context path ''  
  281. 2018-05-29 15:43:02,787:INFO main (StartupInfoLogger.java:59) - Started SpringbootTestApplication in 4.5 seconds (JVM running for 6.28)  

我们发现相较于之前多出了很多日志出现

接下来是devtools热部署,对于开发来说爽多了,比关闭再启动都要快很多很多~~~~看一下pom的配置

[html]  view plain  copy
  1.             <dependency>  
  2.             <groupId>org.springframework.boot</groupId>  
  3.             <artifactId>spring-boot-devtools</artifactId>  
  4.             <optional>true</optional> <!-- 表示依赖不会传递 -->  
  5.         </dependency>  
[html]  view plain  copy
  1.             <build>  
  2.         <plugins>  
  3.             <plugin>  
  4.                 <groupId>org.springframework.boot</groupId>  
  5.                 <artifactId>spring-boot-maven-plugin</artifactId>  
  6.                 <configuration>  
  7.                     <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->  
  8.                 </configuration>  
  9.             </plugin>  
  10.         </plugins>  
  11.         </build>  
然后修改一下配置试一下,基本5秒搞定,打完收工

猜你喜欢

转载自blog.csdn.net/weixin_41690905/article/details/80745741